Sponsored Content
Top Forums UNIX for Advanced & Expert Users Removing special chars from file and maintain field separator Post 302941802 by vgersh99 on Tuesday 21st of April 2015 09:41:33 AM
Old 04-21-2015
try: s/[^ ~-]/ /pg instead.
Any particular reason why you're using cat?
And why you're not using code tags?
 

10 More Discussions You Might Find Interesting

1. Solaris

removing special characters, white spaces from a field in a file

what my code is doing, it is executing a sql file and the resullset of the query is getting stored in the text file in a fixed format. for that fixed format i have used the following code:: Code: awk -F":"... (2 Replies)
Discussion started by: priyanka3006
2 Replies

2. Shell Programming and Scripting

Help in formating a file with field separator

hi thanks a lot But pls help me if my input file is the below format: Name priya 2010-09-21 10:43:49 TEXT ID 1 hi TEXT ID 2 how TEXT ID 3 r TEXT ID 4 u Name2 priya2 2010-09-21 10:43:49 TEXT ID 1 hi1 TEXT ID 2 how1 TEXT ID 3 r1 (4 Replies)
Discussion started by: bha148
4 Replies

3. Shell Programming and Scripting

awk, comma as field separator and text inside double quotes as a field.

Hi, all I need to get fields in a line that are separated by commas, some of the fields are enclosed with double quotes, and they are supposed to be treated as a single field even if there are commas inside the quotes. sample input: for this line, 5 fields are supposed to be extracted, they... (8 Replies)
Discussion started by: kevintse
8 Replies

4. Shell Programming and Scripting

Removing unknow chars from file names.

I'm trying to move a large folder to an external drive but some files have these weird chars that the external drive won't accept. Does anyone know any command of any bash script that will look through a given folder and remove any weird chars? (4 Replies)
Discussion started by: Joktaa
4 Replies

5. Shell Programming and Scripting

Removing rows and chars from text file

Dear community, maybe I'm asking the moon :rolleyes:, but I'm scratching my head to find a solution for it. :wall: I have a file called query.out (coming from Oracle query), the file is like this: ADDR TOTAL -------------------- ---------- TGROUPAGGR... (16 Replies)
Discussion started by: Lord Spectre
16 Replies

6. Shell Programming and Scripting

How to reverse all columns of a file having some field separator?

Hello, I have a file: xandyandz x & y & z x*y*z*a I require output as: zandyandx z & y & x a*z*y*x here all lines have different field seperator (and & * )based on that i want to reverse the column of a file. Pl. help. (8 Replies)
Discussion started by: nehashine
8 Replies

7. Shell Programming and Scripting

Matching two files with special field separator

Hello, I have a file with such structure: >ENSGALG00000000011|ENSGALT00000000012|57|1123|1125 AACTGTGTGTTTTTT >ENSGALG00000000012|ENSGALT00000000013|57|1145|1155 AAAAAAGGTCCTGTGTGC >ENSGALG00000000015|ENSGALT00000000014|57|1144|1155 AAAATGTGTGTGTGTGTGTGTG I want to use another file... (8 Replies)
Discussion started by: Homa
8 Replies

8. Shell Programming and Scripting

shell scripting to determine special chars in file

Hi, I need all your help to achieve the below functionality. I have a big 2 GB file and inside the file we need to identify, whether having a comma(,) or pipe(|) or tab or fixed position or semicolon(;) delimiter. If any of those delimiter found need to replace the file with pipe(|)... (1 Reply)
Discussion started by: lkeswar
1 Replies

9. UNIX for Beginners Questions & Answers

Change encoding, no removing special chars. inconv

Hi all, I'm using iconv command to change files encoding to UTF-8 If my input file has chars as those are removed creating the file without those special chars. I tried using iconv -c, but there is still the removal. Is there a way to keep those special chars changing just the... (6 Replies)
Discussion started by: mrreds
6 Replies

10. UNIX for Beginners Questions & Answers

Shell script to split data with a delimiter having chars and special chars

Hi Team, I have a file a1.txt with data as follows. dfjakjf...asdfkasj</EnableQuotedIDs><SQL><SelectStatement modified='1' type='string'><! The delimiter string: <SelectStatement modified='1' type='string'><! dlm="<SelectStatement modified='1' type='string'><! The above command is... (7 Replies)
Discussion started by: kmanivan82
7 Replies
FBSQL_FETCH_FIELD(3)							 1						      FBSQL_FETCH_FIELD(3)

fbsql_fetch_field - Get column information from a result and return as an object

SYNOPSIS
object fbsql_fetch_field (resource $result, [int $field_offset]) DESCRIPTION
Used in order to obtain information about fields in a certain query result. PARAMETERS
o $ result -A result identifier returned by fbsql_query(3) or fbsql_db_query(3). o $field_offset - The numerical offset of the field. The field index starts at 0. If not specified, the next field that wasn't yet retrieved by fbsql_fetch_field(3) is retrieved. RETURN VALUES
Returns an object containing field information, or FALSE on errors. The properties of the object are: o name - column name o table - name of the table the column belongs to o max_length - maximum length of the column o not_null - 1 if the column cannot be NULL o type - the type of the column EXAMPLES
Example #1 fbsql_fetch_field(3) example <?php fbsql_connect($host, $user, $password) or die("Could not connect"); $result = fbsql_db_query("database", "select * from table") or die("Query failed"); # get column metadata $i = 0; while ($i < fbsql_num_fields($result)) { echo "Information for column $i:<br /> "; $meta = fbsql_fetch_field($result); if (!$meta) { echo "No information available<br /> "; } echo "<pre> max_length: $meta->max_length name: $meta->name not_null: $meta->not_null table: $meta->table type: $meta->type </pre>"; $i++; } fbsql_free_result($result); ?> SEE ALSO
fbsql_field_seek(3). PHP Documentation Group FBSQL_FETCH_FIELD(3)
All times are GMT -4. The time now is 07:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy