Sponsored Content
Top Forums Shell Programming and Scripting Extract data from an XML file & write into a CSV file Post 302413912 by ss_ss on Sunday 18th of April 2010 09:44:12 AM
Old 04-18-2010
Extract data from an XML file & write into a CSV file

Hi All,

I am having an XML tag like:

Code:
 
          <detail  sim_ser_no_1="898407109001000090"
          imsi_1="452070001000090">
          <security>ADM1[1]=????</security>
          <security>PIN1[1]=????</security>
          <security>PIN2[1]=????</security>
          <security>PUK1[1]=????</security>
          <security>PUK2[1]=????</security>
          </detail>
          <detail sim_ser_no_1="898407109001000091"
          imsi_1="452070001000091">
          <security>ADM1[1]=????</security>
          <security>PIN1[1]=????</security>
          <security>PIN2[1]=????</security>
          <security>PUK1[1]=????</security>
          <security>PUK2[1]=????</security>
          </detail>

and the output I want is like this:
Code:
 
898407109001000090,452070001000090,????,????,????,????,???? 

898407109001000091,452070001000091,????,????,????,????,???? 

and so on...

But not able to get all the values together esp sim_ser_no_1 & imsi_1.

Require your inputs.

Regards
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract string from a file & write to a new file (Perl)

Hi, This is the first time playing around with perl and need some help. Assuming if i have a line of text that looks like this: Date/Time=Nov 18 17:12:11;Device Name=192.168.1.1;Device IP=192.168.1.1;Device Class=IDS;Source IP=155.212.212.111;Source Name=UNKNOWN;Source Port=1679... (3 Replies)
Discussion started by: LuckyGuy
3 Replies

2. Shell Programming and Scripting

Data Extract from XML Log File

Please help me out to extract the Data from the XML Log files. So here is the data ERROR|2010-08-26 00:05:52,958|SERIAL_ID=128279996|ST=2010-08-2600:05:52|DEVICE=113.2.21.12:601|TYPE=TransactionLog... (9 Replies)
Discussion started by: raghunsi
9 Replies

3. Shell Programming and Scripting

How to extract data from csv file

Hello everybody, Here is my problem, I don't know anything about shell programming and my boss is actually asking me to develop a shell script in order to get values in a csv file from a specific date. Here is a sample of the csv file : Date;Enchaînement;Titre;Libellé ;calendrier;Heure début;Heure... (11 Replies)
Discussion started by: freyr
11 Replies

4. Shell Programming and Scripting

Perl extract number from file & write to file

I have 1 file that has elements as follows. Also the CVR(10) and the word "SAUCE" only appear once in the file so maybe a grep command would work? file1 CVR( 9) = 0.385E+05, ! VEHICLE CVR(10) = 0.246E+05, ! SAUCE CVR(11) = 0.162E+03, ! VEHICLE I need to extract the... (6 Replies)
Discussion started by: austinj
6 Replies

5. Shell Programming and Scripting

Extract and parse XML data (statistic value) to csv

Hi All, I need to parse some statistic data from the "measInfo" -eg. 25250000 (as highlighted) and return the result into line by line, and erasing all other unnecessary info/tag. Thought of starting with grep "measInfoID="25250000" but this only returns 1 line. How do I get all the output... (8 Replies)
Discussion started by: jackma
8 Replies

6. Shell Programming and Scripting

Extract data from XML file

Hi , I have input file as XML. following are input data #complex.xml <?xml version="1.0" encoding="UTF-8"?> <TEST_doc xmlns="http://www.w3.org/2001/XMLSchema-instance"> <ENTRY uid="123456"> <protein> <name>PROT001</name> <organism>Human</organism> ... (1 Reply)
Discussion started by: mohan sharma
1 Replies

7. Shell Programming and Scripting

Extract data from XML file and write in CSV file

Hi friend i have input as following XML file <?xml version="1.0"?> <Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.054.001.02"> <BkToCstmrDbtCdtNtfctn> <GrpHdr><MsgId>LBP-RDJ-TE000000-130042430010001001</MsgId><CreDtTm>2013-01-04T03:21:30</CreDtTm></GrpHdr>... (3 Replies)
Discussion started by: mohan sharma
3 Replies

8. Shell Programming and Scripting

How to extract data from xml file using shell scripting?

Hi evry1, This is my 1st post in this forum.Pls help me I want to extract some data froma xml file which has 2000 lines using shell scripting. Actually my xml file has some "audio and video codes" which i need to arrange in a column wise format after extracting it using shell scripting.I... (4 Replies)
Discussion started by: arun_kohan
4 Replies

9. Shell Programming and Scripting

Pass some data from csv to xml file using shell/python

Hello gurus, I have a csv file with bunch of datas in each column. (see attached) Now I have an .xml file in the structure of below: ?xml version="1.0" ?> <component id="root" name="root"> <component id="system" name="system"> <param name="number_of_A" value="8"/> ... (5 Replies)
Discussion started by: Zam_1234
5 Replies

10. Shell Programming and Scripting

Extract Data from XML file.

Hi Guys, I am in a need to extract data from a xml file. The XML file format is as below. <data jsxnamespace="propsbundle" locales=""> <locale> <!--Error messages starts--> <record jsxid="CHARPAIR001" jsxtext=" must be selected"></record> <record... (1 Reply)
Discussion started by: Showdown
1 Replies
QMICLI(1)							   User Commands							 QMICLI(1)

NAME
qmicli - Control QMI devices DESCRIPTION
Usage: lt-qmicli [OPTION...] - Control QMI devices Help Options: -h, --help Show help options --help-all Show all help options --help-dms Show Device Management Service options --help-nas Show Network Access Service options --help-wds Show Wireless Data Service options --help-pbm Show Phonebook Management options --help-uim Show User Identity Module options DMS options --dms-get-ids Get IDs --dms-get-capabilities Get capabilities --dms-get-manufacturer Get manufacturer --dms-get-model Get model --dms-get-revision Get revision --dms-get-msisdn Get MSISDN --dms-get-power-state Get power state --dms-uim-set-pin-protection=[(PIN|PIN2),(disable|enable),(current PIN)] Set PIN protection in the UIM --dms-uim-verify-pin=[(PIN|PIN2),(current PIN)] Verify PIN --dms-uim-unblock-pin=[(PIN|PIN2),(PUK),(new PIN)] Unblock PIN --dms-uim-change-pin=[(PIN|PIN2),(old PIN),(new PIN)] Change PIN --dms-uim-get-pin-status Get PIN status --dms-uim-get-iccid Get ICCID --dms-uim-get-imsi Get IMSI --dms-uim-get-state Get UIM State --dms-uim-get-ck-status=[(pn|pu|pp|pc|pf)] Get CK Status --dms-uim-set-ck-protection=[(pn|pu|pp|pc|pf),(disable),(key)] Disable CK protection --dms-uim-unblock-ck=[(pn|pu|pp|pc|pf),(key)] Unblock CK --dms-get-hardware-revision Get the HW revision --dms-get-operating-mode Get the device operating mode --dms-set-operating-mode=[(Operating mode)] Set the device operating mode --dms-get-time Get the device time --dms-get-prl-version Get the PRL version --dms-get-activation-state Get the state of the service activation --dms-activate-automatic=[Activation Code] Request automatic service activation --dms-activate-manual=[SPC,SID,MDN,MIN] Request manual service activation --dms-get-user-lock-state Get the state of the user lock --dms-set-user-lock-state=[(disable|enable),(current lock code)] Set the state of the user lock --dms-set-user-lock-code=[(old lock code),(new lock code)] Change the user lock code --dms-read-user-data Read user data --dms-write-user-data=[(User data)] Write user data --dms-read-eri-file Read ERI file --dms-restore-factory-defaults=[(Service Programming Code)] Restore factory defaults --dms-validate-service-programming-code=[(Service Programming Code)] Validate the Service Programming Code --dms-get-band-capabilities Get band capabilities --dms-get-factory-sku Get factory stock keeping unit --dms-list-stored-images List stored images --dms-select-stored-image=[modem#,pri#] where # is the index Select stored image --dms-delete-stored-image=[modem#|pri#] where # is the index Delete stored image --dms-reset Reset the service state --dms-noop Just allocate or release a DMS client. Use with `--client-no-release-cid' and/or `--client-cid' NAS options --nas-get-signal-strength Get signal strength --nas-get-signal-info Get signal info --nas-get-tx-rx-info=[(Radio Interface)] Get TX/RX info --nas-get-home-network Get home network --nas-get-serving-system Get serving system --nas-get-system-info Get system info --nas-get-technology-preference Get technology preference --nas-get-system-selection-preference Get system selection preference --nas-set-system-selection-preference=[cdma-1x|cdma-1xevdo|gsm|umts|lte|td-scdma] Set system selection preference --nas-network-scan Scan networks --nas-reset Reset the service state --nas-noop Just allocate or release a NAS client. Use with `--client-no-release-cid' and/or `--client-cid' WDS options --wds-start-network=[(APN),(PAP|CHAP|BOTH),(Username),(Password)] Start network (Authentication, Username and Password are optional) --wds-follow-network Follow the network status until disconnected. Use with `--wds-start-network' --wds-stop-network=[Packet data handle] Stop network --wds-get-packet-service-status Get packet service status --wds-get-packet-statistics Get packet statistics --wds-get-data-bearer-technology Get data bearer technology --wds-get-current-data-bearer-technology Get current data bearer technology --wds-reset Reset the service state --wds-noop Just allocate or release a WDS client. Use with `--client-no-release-cid' and/or `--client-cid' PBM options --pbm-get-all-capabilities Get all phonebook capabilities --pbm-noop Just allocate or release a PBM client. Use with `--client-no-release-cid' and/or `--client-cid' UIM options --uim-read-transparent=[0xNNNN,0xNNNN,...] Read a transparent file given the file path --uim-get-file-attributes=[0xNNNN,0xNNNN,...] Get the attributes of a given file --uim-reset Reset the service state --uim-noop Just allocate or release a UIM client. Use with `--client-no-release-cid' and/or `--client-cid' Application Options: -d, --device=[PATH] Specify device path --get-service-version-info Get service version info --device-set-instance-id=[Instance ID] Set instance ID --device-open-version-info Run version info check when opening device --device-open-sync Run sync operation when opening device --client-cid=[CID] Use the given CID, don't allocate a new one --client-no-release-cid Do not release the CID when exiting -v, --verbose Run action with verbose logs, including the debug ones --silent Run action with no logs; not even the error/warning ones -V, --version Print version qmicli 1.6.0 Copyright (2012) Aleksander Morgado License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
The full documentation for qmicli is maintained as a Texinfo manual. If the info and qmicli programs are properly installed at your site, the command info qmicli should give you access to the complete manual. qmicli September 2013 QMICLI(1)
All times are GMT -4. The time now is 02:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy