Sponsored Content
Top Forums Shell Programming and Scripting How to separate data with varying amounts of underscores? Post 302923226 by junior-helper on Friday 31st of October 2014 11:06:16 AM
Old 10-31-2014
You're welcome Smilie

Btw, here is another approach, handling it with bash's built-ins only, just in case...
Code:
while read line
do
 fqdn=${line%_*}
 if=${line##*_}
# do something with $fqdn and $if here
done <file

This User Gave Thanks to junior-helper For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

count data separate by comma

hi experts, i have some problem with count data which separate by comma, below sample data : 01,011222823b6d,011222823f29,0028a5,002993,6212345678, 659111111111,6598204507,6281105008,6596197849,_,525016160836958,_, ffffffff,000000000000000000000000,_,_,_,fd,fd,ff,00,1,0028a5-002993,_,... (10 Replies)
Discussion started by: bucci
10 Replies

2. Shell Programming and Scripting

Parse apart strings of comma separated data with varying number of fields

I have a situation where I am reading a text file line-by-line. Those lines of data contain comma separated fields of data. However, each line can vary in the number of fields it can contain. What I need to do is parse apart each line and write each field of data found (left to right) into a file.... (7 Replies)
Discussion started by: 2reperry
7 Replies

3. Shell Programming and Scripting

Using AWK to separate data from a large XML file into multiple files

I have a 500 MB XML file from a FileMaker database export, it's formatted horribly (no line breaks at all). The node structure is basically <FMPXMLRESULT> <METADATA> <FIELD att="............." id="..."/> </METADATA> <RESULTSET FOUND="1763457"> <ROW att="....." etc="...."> ... (16 Replies)
Discussion started by: JRy
16 Replies

4. UNIX for Dummies Questions & Answers

How to Separate Odd and Even number from one data set?

Hi, If I want to separate data set to new file by odd and even number. If data set like this 1 ABC 235 hgf 2 DEF 326 kjk 3 XXX 133 kwd 4 YYY 188 fgh If I want separate by colum3 I want result like set 1 1 ABC 235 hgf 3 XXX 133 kwd put to new... (3 Replies)
Discussion started by: GeodusT
3 Replies

5. UNIX for Dummies Questions & Answers

Help with varying data

I have flat file in which the length of the a record is 1000 characters. the last field of the file range is from 951 to 1000. So currently i am getting the last field data to be less than 1000 characters ( from 951 to 1000 i see that the data varies from 10 to 50). So is there a way we can pad up... (18 Replies)
Discussion started by: akshay01987
18 Replies

6. Shell Programming and Scripting

Divide data into separate files

frnds: i want to divide data on the behalf of dotted line and redirectd into new files ) ------------------------- M-GET CONFIRMATION ( ------------------------- M-GET CONFIRMATION ( INVOKE IDENTIFIER final data shuld be into 3 files ...... (6 Replies)
Discussion started by: dodasajan
6 Replies

7. Shell Programming and Scripting

Divide data with specific column values into separate files

hello! i need a little help from you :) ... i need to split a file into separate files depending on two conditions using scripting. The file has no delimiters. The conditions are col 17 = "P" and col 81 = "*", this will go to one output file; col 17 = "R" and col 81 = " ". Here is an example. ... (3 Replies)
Discussion started by: chanclitas
3 Replies

8. Shell Programming and Scripting

How to separate rows of data into another column?

I have data such as below where the value in second field is the same as that in the row after. 123456,22222,John,0,xyz 234567,22222,John1,1,cde 43212,3333,Jean,3,pip 84324,3333,Abel,2,cat I'd like to rearrange the output like below to put such records beside each other and separated with... (5 Replies)
Discussion started by: james2009
5 Replies

9. Shell Programming and Scripting

How to separate data coming in one column of CSV file?

I am running an ISQL command on Sybase DB and getting output of a query in an CSV file. The issue is that all the data comes in to the same column, i want them to be separated in different columns. SQL_COMMAND=command.sql file=file.txt formatFile=formatFile.txt report=report.csv echo... (1 Reply)
Discussion started by: Sharma331
1 Replies

10. UNIX for Beginners Questions & Answers

How to Dump data into CSV file which is Separate by <tab>?

Dear Team, please help me to solve this problem using Linux command. I want to dump this data into an excel sheet, Suppose I have a string like: ABC PQR XYZ ASD then I expect output as a ABC XYZ PQR ASD (3 Replies)
Discussion started by: Shubham1182
3 Replies
GLGETTRANSFORMFEEDBA(3G)					   OpenGL Manual					  GLGETTRANSFORMFEEDBA(3G)

NAME
glGetTransformFeedbackVarying - retrieve information about varying variables selected for transform feedback C SPECIFICATION
void glGetTransformFeedbackVarying(GLuintprogram, GLuintindex, GLsizeibufSize, GLsizei *length, GLsizeisize, GLenum *type, char *name); PARAMETERS
program The name of the target program object. index The index of the varying variable whose information to retrieve. bufSize The maximum number of characters, including the null terminator, that may be written into name. length The address of a variable which will receive the number of characters written into name, excluding the null-terminator. If length is NULL no length is returned. size The address of a variable that will receive the size of the varying. type The address of a variable that will recieve the type of the varying. name The address of a buffer into which will be written the name of the varying. DESCRIPTION
Information about the set of varying variables in a linked program that will be captured during transform feedback may be retrieved by calling glGetTransformFeedbackVarying. glGetTransformFeedbackVarying provides information about the varying variable selected by index. An index of 0 selects the first varying variable specified in the varyings array passed to glTransformFeedbackVaryings(), and an index of GL_TRANSFORM_FEEDBACK_VARYINGS-1 selects the last such variable. The name of the selected varying is returned as a null-terminated string in name. The actual number of characters written into name, excluding the null terminator, is returned in length. If length is NULL, no length is returned. The maximum number of characters that may be written into name, including the null terminator, is specified by bufSize. The length of the longest varying name in program is given by GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH, which can be queried with glGetProgram(). For the selected varying variable, its type is returned into type. The size of the varying is returned into size. The value in size is in units of the type returned in type. The type returned can be any of the scalar, vector, or matrix attribute types returned by glGetActiveAttrib(). If an error occurred, the return parameters length, size, type and name will be unmodified. This command will return as much information about the varying variables as possible. If no information is available, length will be set to zero and name will be an empty string. This situation could arise if glGetTransformFeedbackVarying is called after a failed link. ERRORS
GL_INVALID_VALUE is generated if program is not the name of a program object. GL_INVALID_VALUE is generated if index is greater or equal to the value of GL_TRANSFORM_FEEDBACK_VARYINGS. GL_INVALID_OPERATION is generated program has not been linked. ASSOCIATED GETS
glGetProgram() with argument GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH. SEE ALSO
glBeginTransformFeedback(), glEndTransformFeedback(), glTransformFeedbackVaryings(), glGetProgram() 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/. AUTHORS
opengl.org opengl.org 06/10/2014 GLGETTRANSFORMFEEDBA(3G)
All times are GMT -4. The time now is 10:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy