Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8105571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:12:03+00:00 2026-06-06T00:12:03+00:00

I have a json file exported from phpmyadmin, it looks like this(utf-8 file): [{user_email:

  • 0

I have a json file exported from phpmyadmin, it looks like this(utf-8 file):

[{"user_email": "bh549@sina.cn","followee_id": 1411833182,"create_date": "cdatetime datetime p1 (S\'\\x07\\xdb\\x06\\x13\\x16\\x08(\\r\\xd5\\xcc\' tRp2 ."}, {"user_email": "zaici4@sina.cn","followee_id": 1296426000,"create_date": "cdatetime datetime p1 (S\'\\x07\\xdb\\x07\\x14\\x179\\x16\\x02 \\x08\' tRp2 ."}, {"user_email": "yanaa357@sina.com","followee_id": 1848085255,"create_date": "cdatetime datetime p1 (S\'\\x07\\xdb\\x08\\x13\\x17\\x10\\x0f\\x05\\x1c\\x02\' tRp2 ."}]

each dict is a row in database, and third value in each row is a cpickled string.

then I use form to upload this file to a python script (with post method).

then parse this file in python script like this:

   import cgi, os
    import cgitb; cgitb.enable()
    import json
    #import simplejson as json
    print "Content-type: text/html\n\n"
    try:
        import msvcrt
        msvcrt.setmode (0, os.O_BINARY) # stdin = 0
        msvcrt.setmode (1, os.O_BINARY) # stdout = 1
    except ImportError:
        pass

    form = cgi.FieldStorage()

    file_content = form['mysql_table'].value
    file_content = json.loads(file_content)

then browser print a value error when execute json.loads:

<type 'exceptions.ValueError'>: Invalid control character at: line 1 column 83 (char 83)

the char 83 is a space in third value in first row.

How to fix this problem?

thanks mhawke anyway.but the first problem you said is not exist. There’s no \n because I copy that from print result, in my exported json file, it actually have \n

{"user_email": "bh549@sina.cn","followee_id": 1411833182,"create_date": "cdatetime
datetime
p1
(S\'\\x07\\xdb\\x06\\x13\\x16\\x08(\\r\\xd5\\xcc\'
tRp2
."}, {"user_email": "zaici4@sina.cn","followee_id": 1296426000,"create_date": "cdatetime
datetime
p1
(S\'\\x07\\xdb\\x07\\x14\\x179\\x16\\x02 \\x08\'
tRp2
."}

my be I misunderstand? second problem,It’s phpmyadmin escape the file when export,then how to fix the problem you said?

slouton: I’m write a python script to export table and transform the pickled data. It worked now, seems now way to handle json with pickled data.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:12:05+00:00Added an answer on June 6, 2026 at 12:12 am

    Newlines are not valid in strings in JSON, and if phpMyAdmin is producing them then you should log a bug with the project.

    >>> json.loads('"123"')
    u'123'
    >>> json.loads('"123\n456"')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib64/python2.7/json/__init__.py", line 326, in loads
        return _default_decoder.decode(s)
      File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "/usr/lib64/python2.7/json/decoder.py", line 382, in raw_decode
        obj, end = self.scan_once(s, idx)
    ValueError: Invalid control character at: line 1 column 4 (char 4)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Json file that looks like this: [ { field:val }, ....
I have a json file that looks like this: { status: 200, data: {
I have a JSON object that looks like this. [ { id : 23,
I have a JSON file and i have to read data from this file
I have a json file like this {downloads:[ { url:arquivo1.pdf, descricao:árquivo 1 }, {
I have a json file which contains questions and answers like this. { Questions:
I have a json file with contents like this: { aaa:{ status:available, classkey:dotnet },
I have json file that I have exported using TexturePacker, and it produces this
I have a JSON file which looks like the following: {"posts":[{"Latitude":"53.38246685","lontitude":"-6.41501535"}, {"Latitude":"53.4062787","lontitude":"-6.3767205"}]} and I
I have a JSON file, and i need to extract values from it and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.