Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Need help for data extraction if files Post 302707639 by anamdev on Saturday 29th of September 2012 07:34:56 AM
Old 09-29-2012
Error Need help for data extraction if files

Hello all,

I want to extract some particular data from a files and than add all the values .
but i m not able to cut the particular word(USU-INOCT and USU-OUTOCT) as it is coming not in column. and than able to add values coming in it .

can anyone help me Please
Code:
cat <file name>
 <MSCC-1>   <RSU>  </RSU>  <USU> USU-TariffTimeChange=0 USU-INOCT=12772 USU-OUTOCT=39177</USU> <USU> USU-TariffTimeChange=1 USU-INOCT=178 USU-OUTOCT=144</USU> SID=46 RG=46 R.REASON=VLD </MSCC-1>   
 <MSCC-1>   <GSU>  GSU-TOTOCT=1024000 </GSU>  SID=46 RG=46 VALTIME=1700 RESULT-CODE=2001 V.Q.THRESHOLD=102400 </MSCC-1>   
 <MSCC-1>   <RSU>  </RSU>  <USU> USU-INOCT=139072 USU-OUTOCT=818813</USU> SID=46 RG=46 R.REASON=VLD </MSCC-1>   
 <MSCC-1>   <GSU>  GSU-TOTOCT=1024000 </GSU>  SID=46 RG=46 VALTIME=1700 RESULT-CODE=2001 V.Q.THRESHOLD=102400 </MSCC-1>   
 <MSCC-1>   <RSU>  </RSU>  <USU> USU-INOCT=122714 USU-OUTOCT=902004 USU-R.RES=QEX</USU> SID=46 RG=46 </MSCC-1>   
 <MSCC-1>   <GSU>  GSU-TOTOCT=1024000 </GSU>  SID=46 RG=46 VALTIME=1700 RESULT-CODE=2001 V.Q.THRESHOLD=102400 </MSCC-1>   
 <MSCC-1>   <RSU>  </RSU>  <USU> USU-INOCT=121962 USU-OUTOCT=902846 USU-R.RES=QEX</USU> SID=46 RG=46 </MSCC-1>   
 <MSCC-1>   SID=46 RG=46 RESULT-CODE=4012 </MSCC-1>   
 <MSCC-1>   <USU> USU-INOCT=52 USU-OUTOCT=0</USU> SID=46 RG=46 R.REASON=FNL </MSCC-1>

thanks
akash

Last edited by jim mcnamara; 09-29-2012 at 09:28 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Data Extraction issue.

I have a small problem, I have written a following script, which extracts all the rows from source file which strats with T101 and rights it to another file mydata.dat Script my_script #!/bin/ksh YMONTH=$1 dir1='/home/data' dir2='/clients/source_file' cd $dir1 grep "T101"... (5 Replies)
Discussion started by: irehman
5 Replies

2. Shell Programming and Scripting

help with data extraction script

Hello all, Iam newbie here and to unix programming. I have the following text file. A:Woshington,B:London,C:Paris,D:Manchester,C:Lisbon,E:Cape town. Now I would like extract this and store in database. here is the script I have tried but it did work. CITY1:`echo "$text" | grep "A:"... (11 Replies)
Discussion started by: mam
11 Replies

3. Shell Programming and Scripting

Data Extraction From a File

Hi All, I have a requirement where I have to search the file with some text say "Exception". This exception word can be repeated for more then 10 times. Suppose the "Exception" word is repeated at line numbers say x=10, 50, 60, 120. Now I want to extract all the lines starting from x-5 to... (3 Replies)
Discussion started by: rrangaraju
3 Replies

4. Shell Programming and Scripting

Another data extraction question

Hi, I have a tmp file like below: <ADATA> ANUM=900 ADESC=Saving ATYP=0 TXREGD=0 </ADATA> <ADATA> ANUM=890 ADESC=Saving ATYP=0 ABAL=9000 TXREGD=1 </ADATA> <ADATA> (6 Replies)
Discussion started by: kunigirib
6 Replies

5. Shell Programming and Scripting

Selective extraction of data from a files

Hi, I would like to seek for methods to do selective extraction of line froma file. The scenario as follows: I have a file with content: message a received on 11:10:00 file size: 10 bytes send by abc message b received on 11:20:00 file size: 10 bytes send by abc (3 Replies)
Discussion started by: dwgi32
3 Replies

6. Shell Programming and Scripting

Extraction of data from multiple text files, and creation of a chart

Hello dear friends, My problem as explained below seems really basic. Fact is that I'm totally new to programming, and have only a week to produce a script ( CShell or Perl ? ) to perform this action. While searching on the forums, I found a command that could help me, but I don't know... (2 Replies)
Discussion started by: ackheron
2 Replies

7. Shell Programming and Scripting

Data and return code extraction

Hello everybody, Another day another problem. I have to create a script which collects data from 3 csv files. I would like the script to check file1 which contains different values for the date entered previously. As you can see 01/12/2010 contains actions in the first field and in the... (7 Replies)
Discussion started by: freyr
7 Replies

8. Shell Programming and Scripting

data extraction from a file

Hi Freinds, I have a file1.txt in the following format File1.txt I want to get 2 files from the above file filextra.txt should have the lines which are ending with "<" and remaining lines in the filecompare.txt file. Please help. (3 Replies)
Discussion started by: i150371485
3 Replies

9. Shell Programming and Scripting

CSV file data extraction

Hi I am writing a shell script to parse a CSV file , in which i am facing a problem to separate the columns . Could some one help me with it. IN301330/00001 pvavan kumar limited xyz@ttccpp.com IN302148/00002 PRECIOUS SECURITIES (P) LTD viash@yahoo.co.in IN300239/00000 CENTRE india... (8 Replies)
Discussion started by: nanduri
8 Replies

10. Shell Programming and Scripting

Data extraction from .xml file

Hello, I'm attempting to extract 13 digit numbers beginning with 978 from a data file with the following command: awk '{ for(i=1;i<=NF;i++) if($i ~ /^978/) print $i; }' datafile > outfile This typically works. However, the new data file is an .xml file, and this command is no longer working... (6 Replies)
Discussion started by: palex
6 Replies
file-roller(1)							   User Commands						    file-roller(1)

NAME
file-roller - create, view, modify, or unpack an archive SYNOPSIS
file-roller [--add] [--add-to=archive] [--default-dir=folder] [--extract] [--extract-to=folder] [--force] [--help] [--usage] DESCRIPTION
The File Roller application enables you to create, view, modify, or unpack an archive. An archive is a file that acts as a container for other files. An archive can contain many files, folders, and subfolders, usually in compressed form. OPTIONS
The following options are supported: --add Ask for the name of the archive, then add the files, then quit the application. You can also use -a to specify this option. --add-to=archive Add files to the specified archive, then quit the application. You can also use -d to specify this option. --default-dir=folder Specify the default folder for the--add and --extract options. --extract Ask for the name of the destination folder, then extract the files, then quit the application. You can also use -f to specify this option. --extract-to=folder Extract archives to the specified folder, then quit the application. You can also use -e to specify this option. --force Create the destination folder without asking for confirmation. --help Display help text. You can also use -? to specify this option. --usage Display brief usage text. EXAMPLES
Example 1: Unpacking an Archive example% file-roller --extract archive EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/file-roller Executable for File Roller application. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNW | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
File Roller Manual NOTES
Written by Laszlo Kovacs, Sun Microsystems Inc., 2003. SunOS 5.10 29 Sep 2003 file-roller(1)
All times are GMT -4. The time now is 08:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy