Sponsored Content
Top Forums UNIX for Dummies Questions & Answers removing commas from text file Post 34962 by oombera on Monday 24th of March 2003 09:35:30 AM
Old 03-24-2003
Well, here's one way:

Code:
sed -e 's/xxxxxxxxxxxxxx,xxx,xxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxx/' some_file > TMP_00
cp TMP_00 some_file
rm TMP_00

 

10 More Discussions You Might Find Interesting

1. HP-UX

Padding zeros after removing commas in file

Hi Gurus, There is a ASCII file in which a comma is used as a seperator for the amount field when the amount exceed seven digits: e.g. 0001300,000. Now, this comma needs to be removed from this field, after padding leading zeros (to maintain the ASCII positions) e.g. 00001300000.... (1 Reply)
Discussion started by: pranag21
1 Replies

2. Programming

Removing empty spaces and adding commas

I have a file which contains numbers as follows: 1234 9876 6789 5677 3452 9087 4562 1367 2678 7891 I need to remove the empty spaces and add commas between the numbers like: 1234,9876,6789,5677,3452, 9087,4562,1367,2678,7891 Can anyone tell me the command to do... (4 Replies)
Discussion started by: jazz
4 Replies

3. Shell Programming and Scripting

Need help in removing commas

i have the below line as output from a script. I want to delete the string "," and get the output without comma, cat D* | grep "bytes free" | awk '{print $3}' | ????? output: 40,966,189,056 Desired O/P: 40966189056 (1 Reply)
Discussion started by: ali560045
1 Replies

4. Shell Programming and Scripting

parsing log files, removing spaces and replace with commas

Hello all i am working on a database to import log files from my systems, but i cannot seem to find the answer. I searched here for a good bit and couldnt peice together what i was looking for. I know you could do this with awk, i just dont know how. Any help would be greatly appreciated.... (6 Replies)
Discussion started by: caddyjoe77
6 Replies

5. Shell Programming and Scripting

Removing commas within semicolon in a flat file

Hi , Im relatively new to unix and have to process a comma serparated flat file . I recieve some of the fields in double quotes and i want to remove it .. INPUT ==== filed1,field2,field3,"fie,ld4" OUTPUT ===== field1,field2,field3,"field4" can anyone tell me how to achieve... (10 Replies)
Discussion started by: r_t_1601
10 Replies

6. Shell Programming and Scripting

Removing commas within semicolon in a flat file

i am recieving a flat file ( comma seperated ) with comma in between double quotes in any of the source fields . i need to remove the comma in double quotes and process the file thereafter fields in file ========= col1,col2,col3,col4 input can be any of the followng... (31 Replies)
Discussion started by: r_t_1601
31 Replies

7. Shell Programming and Scripting

Help with removing additional commas in string

Hi Experts, I have below strings hello,hi,,,,,,start date age,code,,,,,61,season I am trying to format this string to hello,hi,start date age,code,61,season Can anyone please help me in achieving this? Kind Regards, RB (3 Replies)
Discussion started by: ramakanth_burra
3 Replies

8. UNIX for Dummies Questions & Answers

awk for removing special characters and extra commas

Hi, I have a .csv file which as empty lines with comma and some special characters in 3rd column as below. Source data 1,2,3,4,%#,6 ,,,,,, 1,2,3,4,5,6 Target Data 1,2,3,4,5,6I need to remove blank lines and special charcters I am trying to get this using the below awk awk -F","... (2 Replies)
Discussion started by: shruthidwh
2 Replies

9. Shell Programming and Scripting

Removing just the trailing commas :-(

Hi all, I haven't needed to do any shell based editing for nearly 20 years, and no amount of searching around has found me a solution to this very simple problem :-( I have a csv file. Some lines have three commas at the end. This means the invoice hasn't been paid. I'd like to use sed / grep... (4 Replies)
Discussion started by: chardyzulu
4 Replies

10. UNIX for Beginners Questions & Answers

Removing commas from CSV file

Hi I'm creating a sh script to generate a csv file. The CSV contains the values from a sql table. The content looks this: a,b,c,c2,c3,,,,,,,,,,,d,e I have some code that can separate the fields using the comma as delimiter, but some values actually contain commas, such as... (2 Replies)
Discussion started by: preema
2 Replies
msggen(1)							   User Commands							 msggen(1)

NAME
msggen - generate a machine independent formatted message catalog SYNOPSIS
msggen [-fls] catfile [msgfile] DESCRIPTION
msggen merges the message text source file msgfile into a machine independent formatted message catalog catfile. The file catfile is cre- ated if it does not already exist. If catfile does exist, its messages are included in the new catfile. If set and message numbers collide, the new message text defined in msgfile replaces the old message text currently contained in catfile. Non-ASCII characters must be UTF-8 encoded. iconv(1) can be used to convert to/from UTF-8. OPTIONS
The following options are supported: -f List the printf(3C) format signature for each message in catfile. A format signature is one line containing one character for --format each format specification: c char d double D long double f float h short i int j long long l long p void* s string t ptrdiff_t z size_t ? unknown -l List catfile in UTF-8 msgfile form. --list -s Convert the catfile to a message set number and print the number on the standard output. --set OPERANDS
The following operands are supported: catfile Machine independent formatted message catalog file. msgfile Message text source file. USAGE
Message text source files are in gencat(1) format, defined as follows. The fields of a message text source line are separated by a single blank character. Any other blank characters are considered to be part of the subsequent field. The NL_* constants are defined in one or both of <limits.h> and <nl_types.h>. $ comment A line beginning with a $ followed by a blank character is treated as a comment. $delset n comment This line deletes message set n from an existing message catalog. n denotes the set number [1, NL_SETMAX]. Any text following the set number is treated as a comment. $quote c This line specifies an optional quote character c, which can be used to surround message-text so that trailing spaces or empty messages are visible in a message source line. By default, or if an empty $quote directive is supplied, no quoting of message-text is recog- nized. $set n comment This line specifies the set identifier of the following messages until the next $set or end-of-file (EOF) appears. n denotes the set identifier, which is defined as a number in the range [1, NL_SETMAX]. Set numbers need not be contiguous. Any text following the set identifier is treated as a comment. If no $set directive is specified in a message text source file, all messages are located in mes- sage set 1. $translation identification YYYY-MM-DD[,...] Append translation information to the message catalog header. Only the newest date for a given identification is retained in the cata- log. Multiple translation lines are combined into a single, comma-separated list. m message-text m denotes the message identifier, which is defined as a number in the range [1, NL_MSGMAX]. The message-text is stored in the message catalogue with the set identifier specified by the last $set directive, and with message identifier m. If the message-text is empty, and a blank character field separator is present, an empty string is stored in the message catalogue. If a message source line has a message number, but neither a field separator nor message-text, the existing message with that number (if any) is deleted from the cat- alogue. Message identifiers need not be contiguous. There are no message-text length restrictions. EXIT STATUS
0 Successful completion. >0 One or more specified jobs does not exist. EXAMPLES
Example 1 Using msggen The following example generates a message catalog xxx from the message file xxx.msg: example% msggen xxx xxx.msg AUTHORS
Glenn Fowler, gsf@research.att.com ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWastdev | +-----------------------------+-----------------------------+ |Interface Stability |Volatile | +-----------------------------+-----------------------------+ SEE ALSO
gencat(1), iconv(1), msgcc(1), printf(3C), attributes(5) SunOS 5.11 9 Oct 2007 msggen(1)
All times are GMT -4. The time now is 04:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy