Sponsored Content
Operating Systems Linux Red Hat Special control characters in file Post 302915998 by srikanth38 on Friday 5th of September 2014 04:16:31 PM
Old 09-05-2014
Special control characters in file

Hi Guys,

We receive some huge files on to Linux server. Source system use FTP mechanism to transfer these files on our server. Occasionally one record is getting corrupted while transfer, some control characters are injecting into the file. How to fix this issue ? please advice ?

Sample Corrupted Record:

Code:
A|06/02/2013|11/03/2013|90|90|90|92|90|99|99|1|90-90-90-92-90-99-99|90-90-90-92-90-99-99-1|FX|US|6|289814345|289814345|SBC AMERITECH|FX|||US|532024303|U108024050|AT&T INC.|FX|US|1||D31887602||FX|US|0||N|N|S|0|||0|0|0||||D|0||152745w]M-LM-^G|599001.74|0|0|FX|FDFR|

Correct Record is as follows:

Code:
A|06/02/2013|11/03/2013|90|90|90|92|90|99|99|1|90-90-90-92-90-99-99|90-90-90-92-90-99-99-1|FX|US|6|289814345|289814345|SBC AMERITECH|FX|||US|532024303|U108024050|AT&T INC.|FX|US|1||D31887602||FX|US|0||N|N|S|0|||0|0|0||||D|0||152745444.00|599001.74|0|0|FX|FDFR|


Last edited by jim mcnamara; 09-05-2014 at 05:48 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to see special characters in a file using vi

Hi, I have a file which has special characters. I can't see them when I "vi" the file. But I am sure there are some special un seen characters. How can I see them? Please help. Thx (6 Replies)
Discussion started by: jingi1234
6 Replies

2. UNIX for Dummies Questions & Answers

Replace Special characters in a file

Hi, I have a data like this in a file, 402003279034002000100147626030003300010000000000002000029000000 ær^M^\MÍW^H I need to replace those special char to some other char like # or $ Is there any ways to do it... I tried commands tr,sed and many but it was not able to replace because... (1 Reply)
Discussion started by: solai
1 Replies

3. Programming

Problem with control file and special character

I am getting error when loading data file using ctl file. I get this error only when there is special character. Below is some data. DataFile=> company_id|ciu_id|english_name|iso_country_code|active|partner_name 1-2JT-122||Expert Järvenpää|FI|A|Expert Järvenpää Control File=> LOAD DATA... (1 Reply)
Discussion started by: rshivarkar
1 Replies

4. Shell Programming and Scripting

Is there anyway to grep any special characters from a file ?

Is there any command or shell script to grep any special character from a file ? I have a huge file containing millions of user names; the requirement is to find names containing special characters. #!/bin/bash for i in `cat username.txt` do #COMMAND to grep special character done ... (3 Replies)
Discussion started by: poga
3 Replies

5. Shell Programming and Scripting

Removing special characters - Control M

I have developed a small script to remove the Control M characters that get embedded when we move any file from Windows to Unix. For some reason, its not working in all scenarios. Some times I still see the ^M not being removed. Is there anything missing in the script: cd ${inputDir}... (7 Replies)
Discussion started by: vskr72
7 Replies

6. Shell Programming and Scripting

File containing special characters

Hello All, I am facing challenges in order to transfer a file from windows to unix box,the file contains a special character '×' ,now when I am transferring the file from windows to unix that special character converted to something else like 'Ã' ,another thing I have noticed that the hardware is... (1 Reply)
Discussion started by: prarat
1 Replies

7. Shell Programming and Scripting

Substitute special Characters into a file

Hi experts :) I need to replace special characters into a file , in the followiing way : " --> "" ' --> '' _--> \_ I tried with the sed command but I'm getting and error ksh: $: not found. ksh: $: not found. sed: Function s/\/\/ cannot be parsed. Any idea ? Thanks , KOLAS... (2 Replies)
Discussion started by: Kolas79
2 Replies

8. Shell Programming and Scripting

How to view the control characters in a file?

Hello, How can I view control and special characters of a text file?. For example, space, tabs, new line chars etc. Can I use hexdump for it? Thanks (3 Replies)
Discussion started by: reddyr
3 Replies

9. UNIX for Dummies Questions & Answers

Naming file with special characters ?

Hi all, I have a problem with file naming in linux. I have to create a file named like 11/22.csv but shell displays error: no such file or dir. Problem is / character in the file name. I searched unix linux naming concepts and it's restricted in OS. Please tell me if there's any other chance? OS... (3 Replies)
Discussion started by: sembii
3 Replies

10. Shell Programming and Scripting

Parsing a file containing special characters

I want to parse a file containing special characters, below is a sample content of file content of file : Serial_no:1$$@#first_name:Rahane$$@last_name:Ajiyenke@@#profession:cricketer!@#*&^ Serial_no:1$$@#first_name:Rahane$$@last_name:Ajiyenke@@#profession:cricketer!@#*&^... (3 Replies)
Discussion started by: rajMjar
3 Replies
xferlog(5)							File Formats Manual							xferlog(5)

NAME
xferlog - FTP server logfile SYNOPSIS
DESCRIPTION
The file contains logging information from the FTP server daemon, (see ftpd(1M)). This file is found in Each server entry is composed of a single line of the following form, with all fields being separated by spaces. current-time transfer-time remote-host file-size filename transfer-type special-action-flag direction access-mode username service-name authentication-method authenticated-user-id completion-status current-time The current local time in the form "DDD MMM dd hh:mm:ss YYYY". Where DDD is the day of the week, MMM is the month, dd is the day of the month, hh is the hour, mm is the minutes, ss is the seconds, and YYYY is the year. transfer-time The total time in seconds for the transfer. remote-host The remote host name. file-size The size of the transferred file in bytes. filename The name of the transferred file. transfer-type A single character indicating the type of transfer. Can be one of: for an ascii transfer for a binary transfer special-action-flag One or more single character flags indicating any special action taken. Can be one or more of: file was compressed file was uncompressed file was tar'ed no action was taken direction The direction of the transfer. Can be one of: outgoing incoming access-mode The method by which the user is logged in. Can be one of: (anonymous) is for an anonymous guest user. (guest) is for an passworded guest user (see the command in ftpaccess(4)). (real) is for a local authenticated user. username The local username, or if guest, the ID string given. service-name The name of the service being invoked, usually FTP. authentication-method The method of authentication used. Can be one of: none RFC931 Authentication authenticated-user-id The user id returned by the authentication method. A * is used if an authenticated user id is not available. completion-status This is a single character indicating the status of the transfer. It can be one of: complete transfer incomplete transfer FILES
AUTHOR was developed by the Washington University, St. Louis, Missouri. SEE ALSO
ftpd(1M), ftpaccess(4), syslog(3C). xferlog(5)
All times are GMT -4. The time now is 06:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy