Sponsored Content
Full Discussion: Appending column to rows
Top Forums Shell Programming and Scripting Appending column to rows Post 302673053 by unme on Tuesday 17th of July 2012 11:46:57 AM
Old 07-17-2012
Appending column to rows

Hi All,
Input.txt
Code:
KGO Id "003" .......... .......... Par "CPara" BIN RECGET Name "DIR_PATH" Prompt "DIR_PATH" END RECGET KGO ............ .......... ............... KGO Id "077" .......... .......... Par "CPara" BIN RECGET Name "FILE" Prompt "Enter File" END RECGET KGO ......... .......... ..........

Desired output should be:
Code:
Id,Name,Prompt 003,DIR_Path,Enter DIR_Path 007,File,Enter File

I have tried:
Code:
$grep -i -e Id -e Name -e Prompt Input.txt | sed '/ //g' Id "003" Name "DIR_PATH" Prompt "DIR_PATH" Id "077" Name "FILE" Prompt "Enter File"

Help me how to achieve this

---------- Post updated at 09:16 PM ---------- Previous update was at 09:08 PM ----------

Got the solution from previous post...
Code:
$grep -i -e Id -e Name -e Prompt Input.txt | sed '/   //g' > temp
$paste -sd',,\n' temp

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Appending a column in one file to the corresponding line in a second

It appears that this has been asked and answered in similar fashions previously, but I am still unsure how to approach this. I have two files containing user information: fileA ttim:/home/ttim:Tiny Tim:632 ppinto:/home/ppinto:Pam Pinto:633 fileB ttim:xkfgjkd*&#^jhdfh... (3 Replies)
Discussion started by: suzannef
3 Replies

2. Shell Programming and Scripting

appending column file

Hi all, I have two files with the same number of lines the first file is a.dat and looks like 0.000 1.000 1.000 2.000 ... the fields are tab separated the second file is b.dat and looks like 1.2347 0.546 2.3564 0.321 ... the fields are tab separated I would like to have a file c.dat... (4 Replies)
Discussion started by: f_o_555
4 Replies

3. UNIX for Dummies Questions & Answers

How to sum rows in e.g. column 1 by a category in e.g. column 2

Hi, I've shown an example of what I would like to achieve below. In the example file, I would like to sum the values in column 2 for each distinct category in column 3 (presumably making an array?) and print the sum as well as the category name and length (note:length always corresponds with... (8 Replies)
Discussion started by: auburn
8 Replies

4. Shell Programming and Scripting

Appending new column to existing files

Hi, i want to add another column to existing files containing strings and need to have the final output as a csv file. i have quite a number of files, each with varying number of rows and i need to append the string "test" for all the valid rows for each file. my sample raw files looks like this... (8 Replies)
Discussion started by: ida1215
8 Replies

5. UNIX for Dummies Questions & Answers

Converting column to rows for every 3 lines in the column

Hi gurus! Please help me with this one. I have an file with the following contents: a b c d e f g h i j I would like to make to transform it to look like this as my output file: a,b,c d,e,f (4 Replies)
Discussion started by: kokoro
4 Replies

6. Shell Programming and Scripting

awk command to print only selected rows in a particular column specified by column name

Dear All, I have a data file input.csv like below. (Only five column shown here for example.) Data1,StepNo,Data2,Data3,Data4 2,1,3,4,5 3,1,5,6,7 3,2,4,5,6 5,3,5,5,6 From this I want the below output Data1,StepNo,Data2,Data3,Data4 2,1,3,4,5 3,1,5,6,7 where the second column... (4 Replies)
Discussion started by: ks_reddy
4 Replies

7. UNIX for Dummies Questions & Answers

merging rows into new file based on rows and first column

I have 2 files, file01= 7 columns, row unknown (but few) file02= 7 columns, row unknown (but many) now I want to create an output with the first field that is shared in both of them and then subtract the results from the rest of the fields and print there e.g. file 01 James|0|50|25|10|50|30... (1 Reply)
Discussion started by: A-V
1 Replies

8. UNIX for Dummies Questions & Answers

[Solved] Deleting all rows where the first column equals the second column

Hi, I have a tab delimited text file where the first two columns equal numbers. I want to delete all rows where the value in the first column equals the second column. How do I go about doing that? Thanks! Input: 1 1 ABC DEF 2 2 IJK LMN 1 2 ZYX OPW Output: 1 2 ZYX OPW (2 Replies)
Discussion started by: evelibertine
2 Replies

9. Shell Programming and Scripting

Appending = in particular column in csv file

Hi, I have a requirement to append = in particular row in csv file. Data in csv is as follow: row1,a,a,a row2,b,b,b row3,c,c,c row4,d,d,d csv should be modified at row3 and no. of columns are not fixed but rows are. output should be as: row1,a,a,a row2,b,b,b row3,=c,=c,=c... (2 Replies)
Discussion started by: Divya1987
2 Replies

10. Shell Programming and Scripting

Converting Single Column into Multiple rows, but with strings to specific tab column

Dear fellows, I need your help. I'm trying to write a script to convert a single column into multiple rows. But it need to recognize the beginning of the string and set it to its specific Column number. Each Line (loop) begins with digit (RANGE). At this moment it's kind of working, but it... (6 Replies)
Discussion started by: AK47
6 Replies
fribidi_remove_bidi_marks(3)					Programmer's Manual				      fribidi_remove_bidi_marks(3)

NAME
fribidi_remove_bidi_marks - remove bidi marks out of an string SYNOPSIS
#include <fribidi.h> FriBidiStrIndex fribidi_remove_bidi_marks ( FriBidiChar *str, const FriBidiStrIndex len, FriBidiStrIndex *positions_to_this, FriBidiStrIndex *position_from_this_list, FriBidiLevel *embedding_levels ); PARAMETERS
FriBidiChar *str Input string to clean. const FriBidiStrIndex len Input string length. FriBidiStrIndex *positions_to_this List mapping positions to the order used in str. FriBidiStrIndex *position_from_this_list List mapping positions from the order used in str. FriBidiLevel *embedding_levels List of embedding levels. DESCRIPTION
This function removes the bidi and boundary-neutral marks out of an string and the accompanying lists. It implements rule X9 of the Uni- code Bidirectional Algorithm available at http://www.unicode.org/reports/tr9/#X9, with the exception that it removes U+200E LEFT-TO-RIGHT MARK and U+200F RIGHT-TO-LEFT MARK too. If any of the input lists are NULL, the list is skipped. If str is the visual string, then positions_to_this is positions_L_to_V and position_from_this_list is positions_V_to_L; if str is the logical string, the other way. Moreover, the position maps should be filled with valid entries. A position map pointing to a removed character is filled with -1. By the way, you should not use embedding_levels if str is visual string. For best results this function should be run on a whole paragraph, not lines; but feel free to do otherwise if you know what you are doing. Deprecated. Use fribidi_remove_special_chars instead. RETURNS
New length of the string, or -1 if an error occured (memory allocation failure most probably). SEE ALSO
fribidi_charset_to_unicode(3), fribidi_unicode_to_charset(3), fribidi_parse_charset(3), fribidi_shape_arabic(3), fribidi_get_par_direc- tion(3), fribidi_get_par_embedding_levels(3), fribidi_reorder_line(3), fribidi_get_bidi_type(3), fribidi_get_bidi_types(3), fribidi_get_bidi_type_name(3), fribidi_debug_status(3), fribidi_mirroring_status(3), fribidi_set_mirroring(3), fribidi_reorder_nsm_sta- tus(3), fribidi_set_reorder_nsm(3), fribidi_log2vis_get_embedding_levels(3), fribidi_get_type(3), fribidi_get_type_internal(3), fribidi_log2vis(3), fribidi_join_arabic(3), fribidi_get_joining_type(3), fribidi_get_joining_types(3), fribidi_get_joining_type_name(3), fribidi_get_mirror_char(3), fribidi_shape_mirroring(3), fribidi_shape(3) GNU FriBidi 0.19.2 30 January 2006 fribidi_remove_bidi_marks(3)
All times are GMT -4. The time now is 01:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy