Posted 6 Hours Ago Job ID: 2100364 17 quotes received

Automatically convert CSV files to fixed

Fixed Price or Hourly
Quotes (17)  ·  Premium Quotes (0)  ·  Invited (0)  ·  Hired (0)

  Send before: January 26, 2025

Send a Quote

Programming & Development Programming & Software

Convert two CSV files with different columns into JSON files of the same format. The conversion program can be browsed online, and the file can be downloaded after the conversion. Use HTML statement code, and the website can be run directly online (for example, open and run directly as index.html in the browser). The required functions are very simple. For programming experts, the finished code is estimated to be 200 to 300 lines, and it will not take more than half a day if it is fast. The UI interface should not be too ugly or monotonous, but it can be passed, but the function must be stable.


CSV file to be converted (file name is not fixed, arbitrary):

bd-csvdata.csv

kk-csvdata.csv


File format required after conversion (file name obtained by download is not fixed, arbitrary):

30k-35kjianhua.json


A complete executable HTML statement conversion program is required, with a single function, which is to extract the corresponding column field data of the CSV file, convert and generate the corresponding JSON format data exchange file. The specific requirements are as follows:


1. When converting the CSV file to the JSON data file, the following character segment in the JSON data file remains unchanged. This segment of characters is equivalent to a fixed data header, and no conversion is required. The original JSON data file format and the row in which it is located are strictly retained. At the same time, this segment of characters only needs to appear once at the front in the JSON data file, and it is forbidden to appear in the following data

[

{

"type": "header",

"version": "5.1.1",

"comment": "Export to JSON plugin for PHPMyAdmin"

},

{

"type": "database",

"name": "search"

},

{

"type": "table",

"name": "qf_source",

"database": "search",

"data":

[


2. The first line in the CSV file is the header column description, and each subsequent line is an independent data information. Each column field corresponds to the following fields in the JSON data file. For specific correspondence, refer to the following description


The following are the data information fields in the JSON data file

"source_id": "1",

"title": "",

"url": "",

"description": "",

"content": null,

"page_views": "",

"is_time": "0",

"is_user": "0",

"fid": "",

"is_type": "0",

"code": "",

"source_category_id": "",

"vod_content": "",

"vod_pic": "",

"status": "",

"is_delete": "0",

"create_time": "",

"update_time": ""


The correspondence between the fields in each column of the CSV file and the fields in the JSON data file is as follows:


1. Correspondence between the fields in the kk-csvdata.csv file and the 30k-35kjianhua.json file

title=share name

url=share address

page_views=number of views

code=extraction code

source_category_id=share file parent directory name

status=share status

create_time=share time

update_time=share time


2. Correspondence between the fields in the bd-csvdata.csv file and the 30k-35kjianhua.json file

title=file name

url=link

code=extraction code

status=validity period

create_time=share time

update_time=share time


In addition to the fields with specific corresponding relationships mentioned above, other fields in the JSON data file that do not specify the corresponding relationships strictly retain the original format and assign values according to the original format


III. Further specific requirements are as follows

1. When extracting CSV file data, the source_id field in the JSON data file skips the header row. When the corresponding When the first line of information in the CSV file is assigned a value of 1, when it corresponds to the second line of information in the CSV file, it is assigned a value of 2, and when it corresponds to the third line of information in the CSV file, it is assigned a value of 3, and so on;


2. Assign all the information in the "share name" or "file name" column of the CSV file to the "title" field in the JSON data file intact, ignoring space characters;


3. Assign the information in the "share address" column of the CSV file to the "url" field in the JSON data file, but when extracting the information in this column of the CSV file, only extract the link part, that is, the part starting from "https:", including "https: "The rest of the characters in this column are discarded and not extracted. This is mainly for extracting kk-csvdata.csv format files, while the information in this column of bd-csvdata.csv files only contains link information, without other redundant character information. In addition, when assigning values to this field, the format needs to be slightly modified, that is, it is presented strictly in accordance with the format in the JSON data file;


4. All the information in the "Number of Views" column in the CSV file is assigned to the "page_views" field in the JSON data file intact, ignoring space characters; if there is no space character, assign "0";


5. For kk-csvdata.csv format files, first determine C The "Shared File Previous Directory Name" column in the SV file, if this column contains the character "Sketch", the "source_category_id" field in the JSON data file is assigned to "1", if this column contains the character "Learning", the "source_category_id" field in the JSON data file is assigned to "11", if this column contains the character "Game", the "source_category_id" field in the JSON data file is assigned to "8", if this column contains the character "Software", the "source_category" field in the JSON data file is assigned to " _id" field is "9". If none of the above characters are included, the default value is "7";


6. For the bd-csvdata.csv format file, first determine the "file name" column information in the CSV file. If this column contains the "short play" character, the "source_category_id" field in the JSON data file is assigned to "1". If this column contains the "learning" character, the "source_category_id" field in the JSON data file is assigned to "11". If this column contains the "game" character, the "source_category" field in the JSON data file is assigned to "11". y_id" field is "8". If this column contains the character "software", the "source_category_id" field in the JSON data file is assigned to "9". If none of the above characters are included, the default value is "7";


7. First determine the information in the "sharing status" (kk-csvdata.csv file format) or "validity period" (bd-csvdata.csv file format) column in the CSV file. If this column contains the character "expired", the "status" field in the JSON data file is assigned to "0", otherwise it is assigned to "1";


8. Extract the " Share time" column information, and convert this date and time format strictly according to the "create_time" field format in the JSON data file (should be converted to UNIX timestamp), and assign the converted data to the "create_time" and "update_time" fields in the JSON data file at the same time


On the program conversion interface, there must be a file format selection option. When the file format to be converted is bd-csvdata.csv type, the option can be selected as "Baidu", and when the file format to be converted is kk-csvdata.csv type, the option can be selected as "Quark".

... Show more
Yong L China