Hi, I have data in input file like below... I want only data part of the line...
1st record:
"hashId": "12345678",
"userId": "88KK50D4",
"manufId": "60142429549",
2nd record:
"hashId": "88885555",
"userId": "44HH50D4",
"manufId": "23456765444",
but the position of data part starting is not fixed here.
I want only data part in the below format in my output file:
hashid then user id then manufId
12345678 88KK50D4 60142429549
88885555 44HH50D4 23456765444
Is there any way possible thru SORT or any other way ?
The data starting position may not be same, it may vary, But one thing is sure, the 2nd quotes( " ") carries the data, also it is just after the colon (:).
The no. of input records may be many.But the records comes as a JSON format. Here I can give one example of input file which has JSON format data and it has 3 records below.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
How about the number of fields?? your initial post had 3, but your recent one has 8. Can you give another try answering all the questions raised so far?
Quote:
the data starting position may not be same, it may vary
Your recent post appears to show data starting at the same position for the same field. Can you post such an example where it is not?
Hi Arun, Sorry for inconvenience.
Initially user communicates the data was like my 1st post..
But later the user changed the input style of data.
So this looks like the final data which has 8 fields for each records.
The no. of records may not be always same.
But the 1st field will be the confirmationNumber always.
But the data stating position may or may not be same. But it may vary as per user comments. The user assumes the data may not vary but again says may be some records some days, the data position may vary.
So considering that, I feel the data may vary.
The output should be only data fields in 1 line considering the 8 fields.
Initially user communicates the data was like my 1st post..
But later the user changed the input style of data.
maxsubrat, If the 'user' can change from 3 fields to 8 fields within a day then, that means you are probably still in the requirements gathering phase. So, are you posting the requirements from user directly on the forum and expecting your work to be done by the forum members? I had to say this as you have Not shown any effort using PARSE and BUILD.