Sponsored Content
Top Forums Shell Programming and Scripting Converting Multiline Files to Flat Files? Post 302970898 by bud1738 on Wednesday 13th of April 2016 10:32:25 AM
Old 04-13-2016
Converting Multiline Files to Flat Files?

How to convert this:
F1-R1 F1-R2 F1-R3 into a flat file for bash?? Each record
Code:
F2-R1 F2-R2 F2-R3
F3-R1 F3-R2 F3-R3
F4-R1 F4-R2 F4-R3

is on one line with all fields for that record, put into an output file. The output file should look like this when converted:
Code:
F1-R1,F2-R1,F3-R1,F4-R1
F1-R2,F2-R2,F3-R2,F4-R2
F1-R3,F2-R3,F3-R3,F4-R3

Moderator's Comments:
Mod Comment Please use code tags as required by forum rules!

Last edited by RudiC; 04-13-2016 at 12:24 PM.. Reason: Tried my best to add (i)code tags without destroying the post.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Flat Files

I have a flat file like this 0001 THER ULT HEAD & NECK VES 0002 THER ULTRASOUND OF HEART 0003 THER ULT PERIPHERAL VES 0009 OTHER THERAPEUTIC ULTSND 0010 IMPLANT CHEMOTHERA AGENT 0011 INFUS DROTRECOGIN ALFA 0012 ADM INHAL NITRIC OXIDE I need to conver this to a comma delimited flat file... (2 Replies)
Discussion started by: thumsup9
2 Replies

2. Shell Programming and Scripting

Help with Flat Files Please!! BASH (New User)

Hello All, I am brand new to the UNIX world and so far and very intrigued and enjoy scripting. This is just a new language for me. I would really like assistance with the below request. Any help would be greatly appreciated! I want to create a flat file in Vi that has a header field and... (0 Replies)
Discussion started by: cyberjax21
0 Replies

3. Shell Programming and Scripting

Compare 2 flat files

Hi Gurus, I searched the forum but didnt get much info. I want to compare 2 files. 1)Newfile comes today with 2)Old file of previous day. The files are same ,just the new files might have new records sometimes. So I want to capture these new records in another file. Can anyone help... (5 Replies)
Discussion started by: ganesh123
5 Replies

4. Shell Programming and Scripting

Awk Compare Files w/Multiline Records

I'm trying to compare the first column values in two different files that use a numerical value as the key and output the more meaningful value found in the second column of file1 in front of the matching line(s) in file2. My problem is that file2 has multiple records. For example given: FILE1... (4 Replies)
Discussion started by: RacerX
4 Replies

5. Shell Programming and Scripting

Converting Column to Rows in a Flat file

Hi, Request To guide me in writing a shell program for the following requirement: Example:if the Input File contains the follwing data Input File Data: 80723240029,12,323,443,88,98,7,98,67,87 80723240030,12,56,6,,,3,12,56,6,7,2,3,12,56,6,7,2,3,88,98,7,98,67,87... (5 Replies)
Discussion started by: srinikal
5 Replies

6. Shell Programming and Scripting

Compare 2 flat files

Hi Frnds, I have a flat file with millions of records. . Now I on this. (I prefer for AWK as its gives good performance.) Old_file.txt ------------------ 1 gopi ase .... 2 arun pl ... 3 jack sutha .. 4 peter pm .. ... New_file.txt --------------- 4 peter pm .. .. ... (12 Replies)
Discussion started by: Gopal_Engg
12 Replies

7. Shell Programming and Scripting

Converting a flat file in XML

Hello Friends, I am new to UNIX shell scripting. Using bash....Could you please help me in converting a flat file into an XML style output file. Flat file: (Input File entries looks like this) John Miller: 617-569-7996:15 Bunting lane, staten Island, NY: 10/21/79: 60600 The... (4 Replies)
Discussion started by: humkhn
4 Replies

8. Programming

Scripting using flat files

I need some help to create a script that can do the following: I have two flat files with one column that should link the two files' information into one record: 1st Flat File - 3 columns, multiple rows: orderid, Jobnumber, Ordernumber 2nd Flat File - 2 columns, multiple rows: ... (4 Replies)
Discussion started by: Lavelle
4 Replies

9. UNIX for Advanced & Expert Users

Converting the date format in a flat file

Hi All, I am new to this forum, could any one help me out in resolving the below issue. Input of the flat file contains several lines of text for example find below: 5022090,2,4,7154,88,,,,,4/1/2011 0:00,Z,L,2 5022090,3,1,6648,88,,,,,4/1/2011 0:00,Z,,1... (0 Replies)
Discussion started by: av_sagar
0 Replies

10. Shell Programming and Scripting

Help with converting XML to Flat file

Hi Friends, I want to convert a XML file to flat file. Sample I/p: <?xml version='1.0' encoding='UTF-8' ?> <DataFile xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' contactCount='4999' date='2012-04-14' time='22:00:14' xsi:noNamespaceSchemaLocation='gen .xsd'> <Contact... (3 Replies)
Discussion started by: karumudi7
3 Replies
GLSHADEMODEL(3G)														  GLSHADEMODEL(3G)

NAME
glShadeModel - select flat or smooth shading C SPECIFICATION
void glShadeModel( GLenum mode ) PARAMETERS
mode Specifies a symbolic value representing a shading technique. Accepted values are GL_FLAT and GL_SMOOTH. The initial value is GL_SMOOTH. DESCRIPTION
GL primitives can have either flat or smooth shading. Smooth shading, the default, causes the computed colors of vertices to be interpo- lated as the primitive is rasterized, typically assigning different colors to each resulting pixel fragment. Flat shading selects the com- puted color of just one vertex and assigns it to all the pixel fragments generated by rasterizing a single primitive. In either case, the computed color of a vertex is the result of lighting if lighting is enabled, or it is the current color at the time the vertex was speci- fied if lighting is disabled. Flat and smooth shading are indistinguishable for points. Starting when glBegin is issued and counting vertices and primitives from 1, the GL gives each flat-shaded line segment i the computed color of vertex i+1, its second vertex. Counting similarly from 1, the GL gives each flat-shaded polygon the computed color of the vertex listed in the following table. This is the last vertex to specify the polygon in all cases except single polygons, where the first vertex specifies the flat-shaded color. ------------------------------------- Primitive Type of Polygon i Vertex ------------------------------------- Single polygon (i==1) 1 Triangle strip i+2 Triangle fan i+2 Independent triangle 3i Quad strip 2i+2 Independent quad 4i ------------------------------------- Flat and smooth shading are specified by glShadeModel with mode set to GL_FLAT and GL_SMOOTH, respectively. ERRORS
GL_INVALID_ENUM is generated if mode is any value other than GL_FLAT or GL_SMOOTH. GL_INVALID_OPERATION is generated if glShadeModel is executed between the execution of glBegin and the corresponding execution of glEnd. ASSOCIATED GETS
glGet with argument GL_SHADE_MODEL SEE ALSO
glBegin(3G), glColor(3G), glLight(3G), glLightModel(3G) GLSHADEMODEL(3G)
All times are GMT -4. The time now is 07:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy