Sponsored Content
Top Forums Shell Programming and Scripting Seperated a Column from 'ESC' Character seperated file Post 303020418 by rovf on Thursday 19th of July 2018 05:20:36 AM
Old 07-19-2018
Quote:
Originally Posted by neha_suri06
Hi Experts

I have an escape seperated fields in the unix file. And in the below format file I need to extract the first column.
Columns separated by Escape characters! And I thought I have already seen all the weirdnesses of the world!

Extracting one column can be done by the cut command. See man cut. You can specify the column separator with this command.

There are other possibilities too (grep for instance).

How to represent an escape character, depends on the shell you are using. For instance, escape can be represented in bash or zsh by
Code:
$'\e'

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Search and then concat 4m other file (comma seperated)

My query is now a bit simplified. file1.txt names; ID; value1 ; values N; ABC; 1 ; a18 ; ... CDF; 2 ; b16 ; .. ABC; 1 ; c13 ; ...... EFG; 3 ;d12 ; ... file2.txt ID(Unique);smVals; smVal1; smVal N; 1; ...; ...; ...; 2; ..; ..; ..; 3; ..; ..; ..; ... (1 Reply)
Discussion started by: szchmaltz
1 Replies

2. UNIX for Dummies Questions & Answers

Problem with tab seperated file in UNIX

Hi All, I am facing a problem while getting the data from an Oracle table Problem: I am getting rows from an Oracle table to a tab seperated file. One of the columns in that table have value with in between spaces like AAAAA AAA It's loading fine to .tab file. But when... (2 Replies)
Discussion started by: pssandeep
2 Replies

3. Shell Programming and Scripting

Removing blank lines from comma seperated and space seperated file.

Hi, I want to remove empty/blank lines from comma seperated and space seperated files Thanks all for help (11 Replies)
Discussion started by: pinnacle
11 Replies

4. Shell Programming and Scripting

Trimming fields for comma or pipe seperated file

I have file like this FileA: abc , "helloworld" , america def,asia, japan ghi, africa, ipl Output Needed: abc,"helloworld",america def,asia,japan ghi,africa,ipl I would like to implement using awk. I want to trim each field for its leading and trailing spaces. (7 Replies)
Discussion started by: pinnacle
7 Replies

5. Shell Programming and Scripting

Convert comma seperated file to line seperated.

Hi, I have data like this. 1,2,3,4 Output required: 1 2 3 4 I am trying to use tr function but getting error. Help is appreciated. (6 Replies)
Discussion started by: pinnacle
6 Replies

6. UNIX for Advanced & Expert Users

grep 7th column from a file seperated with ^

Hi, Can anyone help: I want to get the 7th column of a file seperated by ^ Num:^ 1^ testdevice1^10.1.1.1^PT1X23^true^HD^175^up^false^bad Num:^ 2^ testdevice2^10.1.1.2^ST1X23^true^SN^175^up^false^bad Expected result: HD SN Appreciate your help. (2 Replies)
Discussion started by: sureshcisco
2 Replies

7. UNIX for Dummies Questions & Answers

Need help removing leading spaces from one field in comma seperated file

Using awk or sed, I'd like to remove leading spaces after a comma and before a right justified number in field 6. Sounds simple but I can't find a solution. Each field's formatting must stay intact. Input: 40,123456-02,160,05/24/2012,02/13/1977, 10699.15,0 Output:... (5 Replies)
Discussion started by: Scottie1954
5 Replies

8. Shell Programming and Scripting

Seperated by columns, merge in a file, sort them on common column

Hi All, I have 4 files in below format. I took them as an example. File 1: Cut from position 1-4 then 6-7 then 8-14 then rest left and make them as columns in one new file. Inserting character H to the initial of all line like HCTOT. CTOT 456787897 Low fever CTOR 556712345 High fever... (2 Replies)
Discussion started by: Mannu2525
2 Replies

9. Shell Programming and Scripting

SUM semicolon-seperated values from txt-file

Hello, (I'm a shell beginner) how can I sum the bold values of the following txt-file (values.txt) with bash shell. The result of the sum should be written in a new txt file (sum.txt): ... Thanks in advance (5 Replies)
Discussion started by: milu
5 Replies

10. Shell Programming and Scripting

Need Help in rearranging the content of a file comma seperated

I have a file with the below content a = test1 b = test2 a = test3 b= test4 c = test6 b = test5 d = test7 d = test9 Need the output to be as follows a = test1,test3 b = test2, test5 c = test6 d = test7, test9 (4 Replies)
Discussion started by: iron_michael86
4 Replies
Tcl_GetKeyedListKeys(TCL)												 Tcl_GetKeyedListKeys(TCL)

NAME
TclX_NewKeyedListObj, TclX_KeyedListGet, TclX_KeyedListSet, TclX_KeyedListDelete, TclX_KeyedListGetKeys - Keyed list management routines. SYNOPSIS
#include <tclExtend.h> Tcl_Obj * TclX_NewKeyedListObj (void); int TclX_KeyedListGet (Tcl_Interp *interp, Tcl_Obj *keylPtr, char *key, Tcl_Obj **valuePtrPtr); int TclX_KeyedListSet (Tcl_Interp *interp, Tcl_Obj *keylPtr, char *key, Tcl_Obj *valuePtr); int TclX_KeyedListDelete (Tcl_Interp *interp, Tcl_Obj *keylPtr, char *key); int TclX_KeyedListGetKeys (Tcl_Interp *interp, Tcl_Obj *keylPtr, char *key, Tcl_Obj **listObjPtrPtr); DESCRIPTION
These routines perform operations on keyed lists. See the Extended Tcl man page for a description of keyed lists. TclX_NewKeyedListObj Create and initialize a new keyed list object. Returns: A pointer to the object. TclX_KeyedListGet Retrieve a key value from a keyed list. Parameters: o interp - Error message will be return in result if there is an error. o keylPtr - Keyed list object to get key from. o key - The name of the key to extract. Will recusively process sub-keys seperated by `.'. o valueObjPtrPtr - If the key is found, a pointer to the key object is returned here. NULL is returned if the key is not present. Returns: o TCL_OK - If the key value was returned. o TCL_BREAK - If the key was not found. o TCL_ERROR - If an error occured. TclX_KeyedListSet Set a key value in keyed list object. Parameters: o interp - Error message will be return in result object. o keylPtr - Keyed list object to update. o key - The name of the key to extract. Will recusively process sub-key seperated by `.'. o valueObjPtr - The value to set for the key. Returns: TCL_OK or TCL_ERROR. TclX_KeyedListDelete Delete a key value from keyed list. Parameters: o interp - Error message will be return in result if there is an error. o keylPtr - Keyed list object to update. o key - The name of the key to extract. Will recusively process sub-key seperated by `.'. Returns: o TCL_OK - If the key was deleted. o TCL_BREAK - If the key was not found. o TCL_ERROR - If an error occured. TclX_KeyedListGetKeys Retrieve a list of keyed list keys. Parameters: o interp - Error message will be return in result if there is an error. o keylPtr - Keyed list object to get key from. o key - The name of the key to get the sub keys for. NULL or empty to retrieve all top level keys. o listObjPtrPtr - List object is returned here with key as values. Returns: o TCL_OK - If the zero or more key where returned. o TCL_BREAK - If the key was not found. o TCL_ERROR - If an error occured. Tcl Tcl_GetKeyedListKeys(TCL)
All times are GMT -4. The time now is 10:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy