Hidden characters in text file

I have extracted a list of values from a database table and exported to a text file. I need a program or code to display if there are hidden characters in my list (text file).
donnie91910Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Evan CutlerVolunteer Chief Information OfficerCommented:
Notepad++ will show you if they're hidden characters.
Open it up in Notepad++ and select View->Show Symbol->Show All Characters

That'll show you all of the characters in the file.
Bill PrewIT / Software Engineering ConsultantCommented:
What exactly do you mean by "hidden characters"?

~bp
donnie91910Author Commented:
I installed Notepad++  and found that there are "CRLF" at the end of each of the entries in the text file.  Is there a way to get rid of the "CRLF"?
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

Evan CutlerVolunteer Chief Information OfficerCommented:
that's a Carraige return and line feed.  Windows uses this as their "end of line"
UNIX uses LF.

if you are having issues reading a file with this, it could be becuase you have the wrong EOL setting.

Goto EDIT->End of line Operations and change them.
Rey Obrero (Capricorn1)Commented:
to get rid of CrLf, you can use the replace() function

replace(string, chr(13) & chr(10),"")   'replace it with empty string

or

replace(string, chr(13) & chr(10)," ")   'replace it with space
Bill PrewIT / Software Engineering ConsultantCommented:
In Notepad++, install the HexEdit add-on, and then view the data in hex mode.  Take a screen capture and post here please.

How are you intending to process the data file, if you intend to read it as a text file then you would not want to remove all <CR><LF> pairs, that's for certain.  Perhaps there is some other binary data in the file that is a problem.

~bp
donnie91910Author Commented:
I am having trouble finding the HexEdit add-on (Plug-in).  is there a website where I can download this add-on?  I am running version  v6.1.2.
Bill PrewIT / Software Engineering ConsultantCommented:
In  Notepad++, do the following to inmstall the HexEd plugin:

- Plugins
- Plugin Manager
- Show Plugin Manager
- Stay on the Available tab
- Scroll down and find HexEd plugin, check it
- Click Install button


After that (can't recall if it requires a restart of Notepad++), then to display the hex representation of the file you currently have open, do:

- Plugins
- HEX-Editor
- View in HEX


You might want to make the HEX font smaller if it seems big on the screen, by:

- Plugins
- HEX-Editor
- Options
- Font tab


Once you have a useful sample of the data take a screen capture and post that here as a picture.

~bp

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sarabandeCommented:
I have extracted a list of values from a database table and exported to a text file.

for each line of this text file there is a pair of CRLF indicating a new line as already explained.

however, windows turns the pair CRLF to a single line feed (LF) whenever the text file was read in text mode what depends on the open mode the program used which could be deduced from extension (.txt, .log, others). if you remove the special characters from text you would lose information of line-break what rarely is good idea even if you want to show the text as one-liner only. instead you would replace the line-break character or line-break sequence by a space, a pipe '|' or other.

I need a program or code to display if there are hidden characters in my list (text file).
if you open the file with normal text editor or visual studio source code editor, you can be sure that each new line has preceded by one single linefeed character. if you open the text file in word you could click the ¶ button and see each linefeed also as a ¶ symbol.

Sara
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.