Sponsored Content
Full Discussion: Concate 2 line into 1 line
Top Forums Shell Programming and Scripting Concate 2 line into 1 line Post 302229855 by vaskarbasak on Thursday 28th of August 2008 05:15:29 AM
Old 08-28-2008
Concate 2 line into 1 line

Hi,

000732140470,DD,R,29.99

,SOM=1
000732145376,DD,R,29.99

,MOM=0,SOM=0
000732155320,DD,R,29.99

,MOM=0
000732156860,DD,D,9.99

,MOM=3,RNO=3,SOM=1
000732156921,DD,D,9.99

,MOM=5,RNO=5,SOM=7
000732157461,DD,R,29.99

,SOM=0
000732173522,DD,D,9.99

,RNO=0

i have to make the format like

000732140470,DD,R,29.99
,SOM=1
000732145376,DD,R,29.99
,MOM=0,SOM=0
000732155320,DD,R,29.99
,MOM=0
000732156860,DD,D,9.99
,MOM=3,RNO=3,SOM=1
000732156921,DD,D,9.99
,MOM=5,RNO=5,SOM=7
000732157461,DD,R,29.99
,SOM=0
000732173522,DD,D,9.99
,RNO=0

pls help me...

Thanks!
vaskar
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how do you parse 1 line at a time of file1 ie. line(n) each line into new file

File 1 <html>ta da....unique file name I want to give file=>343...</html> <html>da ta 234 </html> <html>pa da 542 </html> and so on... File 2 343 234 542 and so on, each line in File 1 one also corresponds with each line in File 2 I have tried several grep, sed, while .. read, do,... (4 Replies)
Discussion started by: web_developer
4 Replies

2. Shell Programming and Scripting

[Solved] Problem in reading a file line by line till it reaches a white line

So, I want to read line-by-line a text file with unknown number of files.... So: a=1 b=1 while ; do b=`sed -n '$ap' test` a=`expr $a + 1` $here do something with b etc done the problem is that sed does not seem to recognise the $a, even when trying sed -n ' $a p' So, I cannot read... (3 Replies)
Discussion started by: hakermania
3 Replies

3. Solaris

Line too long error Replace string with new line line character

I get a file which has all its content in a single row. The file contains xml data containing 3000 records, but all in a single row, making it difficult for Unix to Process the file. I decided to insert a new line character at all occurrences of a particular string in this file (say replacing... (4 Replies)
Discussion started by: ducati
4 Replies

4. Shell Programming and Scripting

how to read the contents of two files line by line and compare the line by line?

Hi All, I'm trying to figure out which are the trusted-ips and which are not using a script file.. I have a file named 'ip-list.txt' which contains some ip addresses and another file named 'trusted-ip-list.txt' which also contains some ip addresses. I want to read a line from... (4 Replies)
Discussion started by: mjavalkar
4 Replies

5. Shell Programming and Scripting

Commenting a specific line and inserting a new line after commented line.

Hello All, I have following file contents cat file #line=aaaaaa #line=bbbbbb #line=cccccc #line=dddddd line=eeeeee #comment=11111 #comment=22222 #comment=33333 #comment=44444 comment=55555 Testing script Good Luck! I would like to comment line line=eeeeee and insert a new line... (19 Replies)
Discussion started by: manishdivs
19 Replies

6. Shell Programming and Scripting

sed command to replace a line at a specific line number with some other line

my requirement is, consider a file output cat output blah sdjfhjkd jsdfhjksdh sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf hellow there this doesnt look good et cetc etc etcetera i want to replace a line of line number 4 ("this doesnt look good") with some other line ... (3 Replies)
Discussion started by: vivek d r
3 Replies

7. Shell Programming and Scripting

Need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line...

Hello, I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be: SRVXPAPI001 ERRO JUN24 07:28:34 1775 REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F ... (8 Replies)
Discussion started by: Ferocci
8 Replies

8. Shell Programming and Scripting

How to read file line by line and compare subset of 1st line with 2nd?

Hi all, I have a log file say Test.log that gets updated continuously and it has data in pipe separated format. A sample log file would look like: <date1>|<data1>|<url1>|<result1> <date2>|<data2>|<url2>|<result2> <date3>|<data3>|<url3>|<result3> <date4>|<data4>|<url4>|<result4> What I... (3 Replies)
Discussion started by: pat_pramod
3 Replies

9. UNIX for Beginners Questions & Answers

Get an output of lines in pattern 1st line then 10th line then 11th line then 20th line and so on.

Input file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 (6 Replies)
Discussion started by: Sagar Singh
6 Replies
nm(1)							      General Commands Manual							     nm(1)

NAME
nm - print name list of common object file SYNOPSIS
format] file ... DESCRIPTION
The command displays the symbol table of each object file, file. There are three general output formats: the default (neither nor specified), specified, and specified. The output formats are described after the "Options" subsection. By default, prints the entire name of the symbols listed. Since object files can have symbol names with an arbitrary number of characters, a name that is longer than the width of the column set aside for names will overflow its column, forcing every column after the name to be misaligned. Options recognizes the following options: Prefix each output line with the name of the object file or archive, file. Equivalent to Demangle C++ names before printing them (ELF only). Display the value and size of a symbol in decimal. This is the default for the default format or the format. Equivalent to Display only and symbols. This option is ignored (see Display full output. This option is in force by default. Display only (global) symbol information. Do not display the output header data. Distinguish between weak and global symbols by appending * to the key letter of weak symbols. Only takes effect with and/or Sort symbols by name, in ascending collation order, before they are printed. This is the default. See in below. Display symbols in the order in which they appear in the symbol table. Display the value and size of a symbol in octal. Equivalent to Display information in a blank-separated output format. Each symbol name is preceded by its value (blanks if undefined) and a letter to indicate type. A lowercase letter indi- cates a local (nonexternal) symbol. (absolute) (bss symbol) (common symbol) (data symbol) (milli symbol) ELF only (notype) ELF only (section region) (tstorage symbol) SOM only (text symbol) (undefined) If the symbol is a secondary definition, the type letter is followed by the letter Note that is not compatible with Display information in a portable output format, as specified below, to standard output. Note that is not compatible with Prefix each output line with the name of the object file or archive, file. Equivalent to (SOM only) Silence some warning messages. Print the section index instead of the section name (ELF only). Display each numeric value in the specified format. format can be one of: Display the value and size of a symbol in decimal. This is the default for the default format or the format. Equivalent to Display the value and size of a symbol in octal. Equivalent to Display the value and size of a symbol in hexadecimal. This is the default for the format. Equivalent to (SOM only) Truncate every name that would otherwise overflow its column and place an asterisk as the last character in the displayed name to mark it as truncated. If or is also specified, the file prefix is truncated first. Display undefined symbols only. Print the usage menu. Sort symbols by value before they are printed. Display the executing version of the command on standard error. Display the value and size of a symbol in hexadecimal. This is the default for the format. Equivalent to Operands recognizes the following operand: file A relocatable object file or an executable object file, or an archive of relocatable or executable object files. Default Output Format - SOM If the default (neither the nor the option) output format is specified, each symbol has the following columns, separated by vertical bars The default for numbers is decimal or If decimal: If octal: If hexadecimal: Default Output Format - ELF If the default (neither the nor the option) output format is specified, each symbol has the following columns, separated by vertical bars The default for numbers is decimal or If decimal: If octal: If hexadecimal: The descriptions are explained below: name The name of the symbol. value Its value expressed as an offset or an address depending on its storage class. scope The scope of the symbol or The scope indicates an external symbol that is flagged as a secondary definition. type The type of the symbol subspace The subspace to which the symbol belongs. bind Specifies the symbol binding type (local, weak, global). O This field is used for files that have large section tables (>65K sections). For smaller files, the value of this field is 0. Shndx Identifies the index of the section that the symbol belongs to. Identifies the index of the symbol in the symbol table. Output Format for -p If the option is specified, information is displayed using the following portable C-language formats. The default for numbers is decimal or If decimal: If octal: If hexadecimal: If or the line is preceded by: Output Format for -P If the option is specified, information is displayed using the following portable C-language formats. The default for numbers is hexadeci- mal or In the format string, represents string output; represents decimal output; represents octal output; represents hexadecimal output; represents newline; all other characters represent themselves. o If decimal is specified: o If octal is specified: o If hexadecimal is specified, or by default: where library-object is a string preformatted as follows: o If and are not specified, library-object is an empty string. o If or is specified, and the corresponding file operand does not name a library: o If or is specified and the corresponding file operand names a library, object-file names the object file in the library containing the symbol being described: If and are not specified, and if more than one file operand is specified, or if a single file operand that names a library is specified, then prints a line identifying the object containing the symbols before the lines containing those symbols, in one of the following forms: o If the corresponding file operand does not name a library: o If the corresponding file operand names a library, object-file names the object file in the library containing the symbol being described: EXTERNAL INFLUENCES
Environment Variables The following internationalization variables affect the execution of determines the locale category for native language, local customs and coded character set in the absence of or other environment variables. If is not specified or is null, it defaults to (see lang(5)). if set to a nonempty string value, determines the values for all locale categories and has precedence over and other environment variables. determines the locale category for character collation. determines the locale category for character handling functions. determines the locale that should be used to affect the format and contents of diagnostic messages written to standard error. determines the locale category for numeric formatting. and determine the location of message catalogues for processing If an internationalization variable is not specified or is null, it defaults to the value of If is not specified or is null, it defaults to (see lang(5)). If any internationalization variable contains an invalid setting, then all internationalization variables default to (see environ(5)). International Code Set Support Single-byte character code sets are supported. EXAMPLES
Display which object files have undefined references for the symbol Display which object files have a definition for the text symbol leap: WARNINGS
By default, now sorts symbols by name (the option). To turn off sorting, use the option. Some options added for standards conformance duplicate the functionality of options that previously existed. This duplication has been retained for backward compatibility. SEE ALSO
System Tools cc_bundled(1) HP-UX C compiler ld(1) Link editor Miscellaneous crt0(3) Execution startup routine end(3C) Symbol of the last locations in program STANDARDS CONFORMANCE
nm(1)
All times are GMT -4. The time now is 04:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy