Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Converting Space delimited file to Tab delimited file Post 302290454 by va2206 on Monday 23rd of February 2009 10:16:56 AM
Old 02-23-2009
Hi,

Hope the below commands should work.

1.sed 's/t/\t/g' filename

2.cat filename | tr 't' '\t'

Thanks
va2206Smilie
 

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
TMESH2RAD(1)						      General Commands Manual						      TMESH2RAD(1)

NAME
tmesh2rad - convert a triangular mesh to a RADIANCE scene description SYNOPSIS
tmesh2rad [ -o obj ][ -m mat ][ -p pat ] [ input .. ] DESCRIPTION
Tmesh2rad converts one or more triangle-mesh files to a RADIANCE scene description. The -o option may be used to assign a default object name. The single letter "T" is used if no name is given on the command line or in the file. The -m option may be used to assign a default material name. The non-material "void" is used as a default if none is given on the command line or in the file. The -p option may be used to assign a default picture for a surface pattern. If none is given on the command line or in the file, the surface will not have an associated pattern. FILE FORMAT
A triangle-mesh is a free-format ASCII file composed of the following eight primitive types. Each primitive is begun with a single, white- space-delimited letter: # Comment Whatever follows up until the end of line is passed as a comment to the output. Note that there must be at least one space or tab following the pound-sign. o name The white-space-delimited string name is used as a prefix for all following output triangles. m material The white-space-delimited string material is used as the modifier name for all following output triangles. p picture The white-space-delimited string picture is used as the name of the RADIANCE picture file to be used as a pattern for all follow- ing output triangles with properly defined vertices. (See i primitive below.) v id x y z Defines the vertex id with 3-dimensional coordinates x, y and z. The identifier, id must be some small, non-negative integer value. If the same integer is used for a later vertex definition, this definition will be lost, though any triangles using the vertex prior to its redefinition will be unaffected. n nx ny nz Defines a surface normal vector with the 3-dimensional components nx, ny and nz. This vector will be associated with the most recently defined vertex, and is often placed on the same line as the vertex definition for clarity. The vector need not be nor- malized. i u v Defines a picture index for the most recently defined vertex. The u value will be used to lookup the horizontal pixel coordinate in the currently defined picture. The v value will be used to lookup the vertical pixel coordinate. (See the RADIANCE reference manual for details on picture coordinate values.) As with associated surface normals, picture indices are interpolated using barycentric coordinates based on the triangle vertices. If these coordinates are calculated correctly, this should result in a smooth mapping of a pattern onto the surface mesh. t id1 id2 id3 Create a triangle connecting the three vertices identified by id1, id2 and id3. The right-hand rule is used to determine the default surface normal orientation, and this should not be too far from the associated vertex normals (if any). All three ver- tices must have an associated normal if the triangle is to be smoothed. If a picture file is defined and all three vertices have pattern indices associated with them, then this picture will be used as a pattern to modify the triangle's color. We realize there are many similar T-mesh file formats in existence, and that it would have been just as easy to support one of these for- mats directly. The disadvantage to supporting an existing format is that conversion from other formats might prove difficult. It was our hope to provide a "greatest common multiple" format that would support all similar T-mesh formats, rather than supporting WaveFront's .obj format (for example) and being unable to associate a pattern with an object. Converting from other formats should be relatively straight- forward. In many cases, an awk(1), rcalc(1) or even a sed(1) script should be sufficient. EXAMPLE
Here is an example T-mesh file: # Our object name: o test_object # Our material: m puce # Our vertices: v 1 10 15 5 v 2 10 -15 5 v 3 0 -15 0 v 4 -10 15 -5 # Two triangles joined together: t 1 2 3 t 2 3 4 Which generates the following output: ## T-mesh read from: <stdin> # Our material: # Our vertices: # Two triangles joined together: puce polygon test_object.1 0 0 9 10 15 5 10 -15 5 0 -15 0 puce polygon test_object.2 0 0 9 10 -15 5 0 -15 0 -10 15 -5 Here is another example: # A partial cylinder: m BluePlastic v 1 -14.673 -3.119 50 n -0.95677 -0.203374 1.17936e-10 v 2 -12.136 -8.817 -50 n -0.791363 -0.574922 4.84915e-10 v 3 -12.136 -8.817 50 n -0.791363 -0.574922 4.84915e-10 t 1 2 3 m OrangePlastic v 1 -7.501 -12.991 50 n -0.549094 -0.812427 -1.45812e-09 v 2 -12.136 -8.817 50 n -0.791363 -0.574922 4.84915e-10 v 3 -12.136 -8.817 -50 n -0.791363 -0.574922 4.84915e-10 t 1 2 3 m BluePlastic v 1 -1.568 -14.918 50 n -0.171094 -0.965568 -5.69788e-09 v 2 -7.501 -12.991 50 n -0.549094 -0.812427 -1.45812e-09 v 3 -7.501 -12.991 -50 n -0.429001 -0.881759 -3.6502e-09 t 1 2 3 Note that the same three vertices were used repeatedly, and intermingled with the triangle definitions. AUTHOR
Greg Ward BUGS
Triangle smoothing doesn't work very well for glass or trans material types in Radiance, since textures cause distorted transmission through these materials. It is best to use the dielectric material type if smooth transmission is desired. SEE ALSO
arch2rad(1), awk(1), ies2rad(1), thf2rad(1), oconv(1), rcalc(1), sed(1), xform(1) RADIANCE
3/18/96 TMESH2RAD(1)
All times are GMT -4. The time now is 03:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy