textfiles

Java BufferedReader back to the top of a text file?

I currently have 2 BufferedReaders initialize on the same text file. When I'm done reading the reading the text file with the first BufferedReader, I use the second one to make another pass thru the file from the top. Multiple passes thru the same file are necessary. I know about reset(), but it needs a previous call to mark() and mark...

Ragged Right text files with many suppressed columns into SQL Server 2005 - SSIS or other tool?

The ragged right flat file option is great for a single trailing field terminated with a CRLF, but when any number of trailing fields which are blank are suppressed and the line terminated early with CRLF, I have found no alternative in SSIS but to read a few columns in with a single "REMAINDER" column and then used a Derived Column tran...

I need a quick and dirty way to append to a text file in vb.net

I've got a very small standalone vb.net app that gets run automatically. Every now and then it hits an error condition that I want to log and then keep processing. But, this is far too minor a thing to store in the system's main log - I really just want to append a line to a text file. What's the least stress way to append a line of t...

C# Parsing Best Practices

Hey Folks ! I need to parse some known file formats, one of them is the CUSCAR format, i strongly believe that RegEx will do the job ,any suggestions ? ...

Response.Write DataTable Data to Text File, ASP.net Hangs

Very odd problem as this is working perfectly on our old Classic ASP site. We are basically querying the database and exporting around 2200 lines of text to a Text File through Response.Write to be output to a dialog box and allows the user to save the file. Response.Clear() Response.ClearContent() Response.ClearHeaders(...

How do I split a huge text file in python

I have a huge text file (~1GB) and sadly the text editor I use won't read such a large file. However, if I can just split it into two or three parts I'll be fine, so, as an exercise I wanted to write a program in python to do it. What I think I want the program to do is to find the size of a file, divide that number into parts, and f...

How do i parse a text file in c#.

How do i parse a text file in c#? ...

What's the best way of doing dos2unix on a 500k line file, in Windows?

Question says it all, I've got a 500,000 line file that gets generated as part of an automated build process on a Windows box and it's riddled with ^M's. When it goes out the door it needs to *nix friendly, what's the best approach here, is there a handy snippet of code that could do this for me? Or do I need to write a little C# or Java...

Tools to search for strings inside files without indexing

I have to change some connection strings in an incredibly old legacy application, and the programmers who made it thought it would be a great idea to plaster the entire app with connection strings all over the place. VS "current project" search is INCREDIBLY slow, and I don't trust Windows Search. So what's the best free, non-indexed t...

How to read a Chinese text file from C#?

Hi, How can I read a Chinese text file using C#, my current code can't display the correct characters: try { using (StreamReader sr = new StreamReader(path,System.Text.Encoding.UTF8)) { // This is an arbitrary size for this example. string c = null; while (sr.Peek() >= 0) { c = n...

Is there an upper limit on .txt file size?

As a Christmas gift I have written a small program in Java to calculate primes. My intention was to leave it on all night, calculating the next prime and writing it to a .txt file. In the morning I would kill the program and take the .txt file to my friend for Christmas. Is there anything I should be worried about? Bear in mind that thi...

Is there a size limit on a text file?

Duplicate of: Is there an upper limit on .txt file size? What is the limit to how much you can write to a text file? Any help would be appreciated. ...

2008 Trend: Best Ultraedit Alternative Free Text Editor You Recommend

2008 has passed and there are new free software or updates for text editors that can take the place of Ultraedit-32, which is arguably the killer app of commercial text editors. We all have searched for that perfect editor, tested them, compared them, and eventually stuck with the one we love the most. Ultraedit-32 features that are po...

Dynamically saving file location

Hello, I have an asp.net app and I am trying to save a text file to a folder that changes with each client. How can I write it to save the files to a folder that changes. For example one customer might be C:\inetpub\wwwroot\site1\ another might be C:\inetpub\wwwroot\site2. Relative paths don't seem to work, and I've tried GetCurrentDire...

Historical reason behind different line ending at different platforms

Why did DOS/Windows and Mac decide to use \r\n and \r for line ending instead of \n? Was it just a result of trying to be "different" from Unix? And now that Mac OS X is Unix (-like), did Apple switch to \n from \r? ...

Full text indexer with line level results, substring searches, and incremental update support?

I'm looking for a full text indexing package that is being maintained (i.e. not an end of life dead package) that can would ideally have support for: substring matches incremental updates line level results Also ideal would be support for boolean matches adjacency searches "stringX found near stringY" A little more detail about t...

Best Way to Automate Adding Text to an Image and formatting for Printing?

Here's what I have: Quarter Sheet Flyer (4 per page) as a PSD or JPG Text file with one entry of text per line. What I want to do: Print out 100 flyers (on 25 pieces of paper) Somehow automate the process of adding the text to the image, either via some scripting language or a Photoshop automated task. Then format the pages to ...

Convert 12-hour date/time to 24-hour date/time

I have a tab delimited file where each record has a timestamp field in 12-hour format: mm/dd/yyyy hh:mm:ss [AM|PM]. I need to quickly convert these fields to 24-hour time: mm/dd/yyyy HH:mm:ss. What would be the best way to do this? I'm running on a Windows platform, but I have access to sed, awk, perl, python, and tcl in addi...

What is the best way to read a text file two lines at a time in Java?

BufferedReader in; String line; while ((line = in.readLine() != null) { processor.doStuffWith(line); } This is how I would process a file line-by-line. In this case, however, I want to send two lines of text to the processor in every iteration. (The text file I'm processing essentially stores one record on two lines, so I'm sendin...

Comparing text files w/ Junit

I am comparing text files in junit using: public static void assertReaders(BufferedReader expected, BufferedReader actual) throws IOException { String line; while ((line = expected.readLine()) != null) { assertEquals(line, actual.readLine()); } assertNull("Actual had more lines then the expected.", ac...