Sponsored Content
Top Forums Shell Programming and Scripting how to read fixed length flat file.... Post 302340662 by zaxxon on Tuesday 4th of August 2009 07:02:35 AM
Old 08-04-2009
To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

******************************************************

Code:
$> echo "xxxxxxiiiiiiiiii@yahoo.com mmmmm"| awk '{print substr($1,7)}'
iiiiiiiiii@yahoo.com
$> echo "xxxxxxiiiiiiiiii@yahoo.com mmmmm"| awk '{print $NF}'
mmmmm

# putting it to variables:

String_email=`awk '{print substr($1,7)}' infile`
String_loc=`awk '{print $NF}' infile`

This will give a list of strings in each varaible. Maybe you want to handle it as arrays or read through it via while/read and parse it or just work it completely in awk, idk.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read variables from line to fixed length

I would like to make a script to read three variables (no fixed length or position) from a line and write them into a file, with fixed length and right-justified in each column. The fixed text (text1-text4) prior to the thee variables and the variables themselves are originally separated by spaces... (3 Replies)
Discussion started by: SharkM
3 Replies

2. UNIX for Dummies Questions & Answers

What the command to find out the record length of a fixed length file?

I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies

3. UNIX for Dummies Questions & Answers

Convert a tab delimited/variable length file to fixed length file

Hi, all. I need to convert a file tab delimited/variable length file in AIX to a fixed lenght file delimited by spaces. This is the input file: 10200002<tab>US$ COM<tab>16/12/2008<tab>2,3775<tab>2,3783 19300978<tab>EURO<tab>16/12/2008<tab>3,28523<tab>3,28657 And this is the expected... (2 Replies)
Discussion started by: Everton_Silveir
2 Replies

4. UNIX for Dummies Questions & Answers

Conditional sorting on fixed length flat file

I have a fixed length file that need to be sorted according to the following rule IF B=1 ORDER by A,B Else ORDER by A,C Input file is ABC 131 112 122 231 212 222 Output needed ABC 112 131 122 212 231 222 (1 Reply)
Discussion started by: zsk_00
1 Replies

5. Shell Programming and Scripting

Exporting a flat fixed length file (Urgent)

Hi All, So far, I've been extracting data from db2 tables and exporting the file as a tab delimited file into a UNIX server using the following command: export to /.../.../.../.../.../SM_RAW_DATA.dat of del modified by coldel| nochardel select a.accno, a.CUR_BL_AM, ... (1 Reply)
Discussion started by: jj2485
1 Replies

6. Shell Programming and Scripting

reading fixed length flat file and calling java code using shell scripting

I am new to shell scripting and I have to to the following I have a flat file with storename(lenth 20) , emailaddress(lenth 40), location(15). There is NO delimiters in that file. Like the following str00001.txt StoreName emailaddress location... (3 Replies)
Discussion started by: willywilly
3 Replies

7. UNIX for Advanced & Expert Users

Insert Delimiter at fixed locations in a flat file

Hi Can somebody help me with solution for this PLEASE? I have a flat file and need to insert delimiters at fixed positions in all the lines so that I can easily convert into EXCEL with columns defined as per their width. For Example Here is the file { kkjhdhal sdfewss sdtereetyw... (7 Replies)
Discussion started by: jd_mca
7 Replies

8. Shell Programming and Scripting

Fixed length flat file extraction

Hii ,I am new to Unix ,i have a flat file which is (fixed length) sitting in unix,Which is holding the data for a table.I want to extract one column(length7-10) on the basis of another column(length13-15) and want only one single row Example: Below is the sample of flat file. 1111 AAAA 100 ... (4 Replies)
Discussion started by: laxmi1166
4 Replies

9. Shell Programming and Scripting

Flat file-make field length equal to header length

Hello Everyone, I am stuck with one issue while working on abstract flat file which i have to use as input and load data to table. Input Data- ------ ------------------------ ---- ----------------- WFI001 Xxxxxx Control Work Item A Number of Records ------ ------------------------... (5 Replies)
Discussion started by: sonali.s.more
5 Replies

10. UNIX for Dummies Questions & Answers

Length of a fixed width file

I have a fixed width file of length 53. when is try to get the lengh of the record of that file i get 2 different answers. awk '{print length;exit}' <File_name> The above code gives me length 50. wc -L <File_name> The above code gives me length 53. Please clarify on... (2 Replies)
Discussion started by: Amrutha24
2 Replies
GLPROVOKINGVERTEX(3G)						    OpenGL 3.3						     GLPROVOKINGVERTEX(3G)

NAME
glProvokingVertex - specifiy the vertex to be used as the source of data for flat shaded varyings C SPECIFICATION
void glProvokingVertex(GLenum provokeMode); PARAMETERS
provokeMode Specifies the vertex to be used as the source of data for flat shaded varyings. DESCRIPTION
Flatshading a vertex shader varying output means to assign all vetices of the primitive the same value for that output. The vertex from which these values is derived is known as the provoking vertex and glProvokingVertex specifies which vertex is to be used as the source of data for flat shaded varyings. provokeMode must be either GL_FIRST_VERTEX_CONVENTION or GL_LAST_VERTEX_CONVENTION, and controls the selection of the vertex whose values are assigned to flatshaded varying outputs. The interpretation of these values for the supported primitive types is: If a vertex or geometry shader is active, user-defined varying outputs may be flatshaded by using the flat qualifier when declaring the output. NOTES
glProvokingVertex is available only if the GL version is 3.2 or greater. ERRORS
GL_INVALID_ENUM is generated if provokeMode is not an accepted value. COPYRIGHT
Copyright (C) 2010 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/. OpenGL 3.3 03/08/2011 GLPROVOKINGVERTEX(3G)
All times are GMT -4. The time now is 12:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy