Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Converting Space delimited file to Tab delimited file Post 302290963 by jeevs81 on Tuesday 24th of February 2009 11:51:27 AM
Old 02-24-2009
Quote:
Originally Posted by va2206
Hi,

Can you please confirm that where is single space in your file?

360200tFY10tFEB-LTFt500420t12t0
460213tFY09tFEB-LTFt500420t09t15000
460213tFY09tFEB-LTFt500420t10t15000
077426tFY10tFEB-LTFt550200t12t0
077426tFY11tFEB-LTFt550200t12t0
677120tFY09tFEB-LTFt550200t07t57
677120tFY09tFEB-LTFt550200t09t57.5
977120tFY09tFEB-LTFt550200t06t561.5
477717tFY10tFEB-LTFt550200t12t0
577000tFY09tFEB-LTFt550200t12t327
577050tFY09tFEB-LTFt550200t08t86

Because of this reason I considered "t" as a delimeter.

Thanks,
va2206Smilie
Hi va2206,

"t" is not the delimiter of my source file. My source file is delimited with a single white space. I need to convert them into tab delimited file. Please help me

Thanks,
Rajeevan D
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting Tab delimited file to Comma delimited file in Unix

Hi, Can anyone let me know on how to convert a Tab delimited file to Comma delimited file in Unix Thanks!! (22 Replies)
Discussion started by: charan81
22 Replies

2. Shell Programming and Scripting

Help with converting Pipe delimited file to Tab Delimited

I have a file which was pipe delimited, I need to make it tab delimited. I tried with sed but no use cat file | sed 's/|//t/g' The above command substituted "/t" not tab in the place of pipe. Sample file: abc|123|2012-01-30|2012-04-28|xyz have to convert to: abc 123... (6 Replies)
Discussion started by: karumudi7
6 Replies

3. UNIX for Dummies Questions & Answers

Changing only the first space to a tab in a space delimited text file

Hi, I have a space delimited text file but I only want to change the first space to a tab and keep the rest of the spaces intact. How do I go about doing that? Thanks! (3 Replies)
Discussion started by: evelibertine
3 Replies

4. Shell Programming and Scripting

How to make tab delimited file to space delimited?

Hi How to make tab delimited file to space delimited? in put file: ABC kgy jkh ghj ash kjl o/p file: ABC kgy jkh ghj ash kjl Use code tags, thanks. (1 Reply)
Discussion started by: jagdishrout
1 Replies

5. Shell Programming and Scripting

Converting varied space delimited file to Pipedemilited

Hi all, I have source file, data looks like 12345 abc def 01 / 001200 C 2000 12345 abc def 01 / 001200 C 2500 12345 abcd def 01 / 001200 C 3500 18945 xyz pqr 01 / 009900 D 4000 5000 2800 9900 Expected ouput... (3 Replies)
Discussion started by: srk409
3 Replies

6. Shell Programming and Scripting

How to convert space&tab delimited file to CSV?

Hello, I have a text file with space and tab (mixed) delimited file and need to convert into CSV. # cat test.txt /dev/rmt/tsmmt32 HP Ultrium 6-SCSI J3LZ 50:03:08:c0:02:72:c0:b5 F00272C0B5 0/0/6/1/1.145.17.255.0.0.0 /dev/rmt/c102t0d0BEST /dev/rmt/tsmmt37 ... (6 Replies)
Discussion started by: prvnrk
6 Replies

7. UNIX for Dummies Questions & Answers

Need to convert a pipe delimited text file to tab delimited

Hi, I have a rquirement in unix as below . I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column. ex: Input Text file: 1|A|apple 2|B|bottle excel file to be generated as output as... (9 Replies)
Discussion started by: raja kakitapall
9 Replies

8. Shell Programming and Scripting

Output file with <Tab> or <Space> Delimited

Input file: xyz,pqrs.lmno,NA,NA,NA,NA,NA,NA,NA abcd,pqrs.xyz,NA,NA,NA,NA,NA,NA,NA Expected Output: xyz pqrs.lmno NA NA NA NA NA NA NA abcd pqrs.xyz NA NA NA NA NA NA NA Command Tried so far: awk -F"," 'BEGIN{OFS=" ";} {print}' $File_Path/File_Name.csv Issue:... (5 Replies)
Discussion started by: TechGyaann
5 Replies

9. Shell Programming and Scripting

Help/Advise please for converting space delimited string variable to comma delimited with quote

Hi, I am wanting to create a script that will construct a SQL statement based on a a space delimited string that it read from a config file. Example of the SQL will be For example, it will read a string like "AAA BBB CCC" and assign to a variable named IN_STRING. I then concatenate... (2 Replies)
Discussion started by: newbie_01
2 Replies

10. UNIX for Beginners Questions & Answers

Replace a column in tab delimited file with column in other tab delimited file,based on match

Hello Everyone.. I want to replace the retail col from FileI with cstp1 col from FileP if the strpno matches in both files FileP.txt ... (2 Replies)
Discussion started by: YogeshG
2 Replies
gencat(1)							   User Commands							 gencat(1)

NAME
gencat - generate a formatted message catalog SYNOPSIS
gencat catfile msgfile... DESCRIPTION
The gencat command merges the message text source file(s) msgfile into a formatted message database catfile. The database 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 col- lide, the new message-text defined in msgfile replaces the old message text currently contained in catfile. The message text source file (or set of files) input to gencat can contain either set and message numbers or simply message numbers, in which case the set NL_SETD (see nl_types.h(3HEAD)) is assumed. Message Text Source File Format The format of a message text source file is defined as follows. Note that the fields of a message text source line are separated by a sin- gle ASCII space or tab character. Any other ASCII spaces or tabs are considered as part of the subsequent field. $set n comment Where n specifies the set identifier of the following messages until the next $set, $delset, or end-of-file appears. n must be a number in the range (1-{NL_SETMAX}). Set identifiers within a single source file need not be contiguous. Any string 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 the default message set NL_SETD. $delset n comment Deletes message set n from an existing message catalog. Any string following the set number is treated as a comment. (Note: if n is not a valid set it is ignored.) $comment A line beginning with a dollar symbol $ followed by an ASCII space or tab character is treated as a comment. m message-text The m denotes the message identifier, a number in the range (1-{NL_MSGMAX}). The message-text is stored in the mes- sage catalog with the set identifier specified by the last $set directive, and with message identifier m. If the mes- sage-text is empty, and an ASCII space or tab field separator is present, an empty string is stored in the message catalog. 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 catalog. Message identifiers need not be contiguous. The length of message-text must be in the range (0-{NL_TEXTMAX}). $quote c This line specifies an optional quote character c, which can be used to surround message-text so that trailing spaces or null (empty) messages are visible in a message source line. By default, or if an empty $quote directive is sup- plied, no quoting of message-text will be recognized. Empty lines in a message text source file are ignored. Text strings can contain the special characters and escape sequences defined in the following table: +--------------------------------------------------------------+ |Description Symbol Sequence | |newline NL(LF) | |horizontal tab HT | |vertical tab VT v | |backspace BS  | |carriage return CR | |form feed FF f | |backslash \ | |bit pattern ddd ddd | +--------------------------------------------------------------+ The escape sequence ddd consists of backslash followed by 1, 2 or 3 octal digits, which are taken to specify the value of the desired character. If the character following a backslash is not one of those specified, the backslash is ignored. Backslash followed by an ASCII newline character is also used to continue a string on the following line. Thus, the following two lines describe a single message string: 1 This line continues to the next line which is equivalent to: 1 This line continues to the next line OPERANDS
The following operands are supported: catfile A path name of the formatted message catalog. If - is specified, standard output is used. msgfile A path name of a message text source file. If - is specified for an instance of msgfile, standard input is used. The format of message text source files is defined in Message Text Source File Format. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of gencat: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWloc | +-----------------------------+-----------------------------+ |CSI |enabled | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
mkmsgs(1), catgets(3C), catopen(3C), gettxt(3C), nl_types.h(3HEAD), attributes(5), environ(5), standards(5) SunOS 5.11 1 Feb 1995 gencat(1)
All times are GMT -4. The time now is 03:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy