Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 734 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extracting data from a tab-delimited file with JavaScript

#1
I'm trying to extract data from a data file that's tab-delimited (in some parts), and really seems like it's going to be a headache to work out (I reallw wish they could just have CSV-ed it).

Here's the data:

[To see links please register here]


Here's the format description:

[To see links please register here]


I'd like to extract this data and store it in a database with serverside javascript, (ASP). Any ideas?
Reply

#2
Your file is not `tab delimited`... it is `position delimited`.

To handle the file using `javascript`, the file must be on the same server and available via `HTTP`.

If you need to upload the file to some server, the server side language need to extract all the data based on your [layout file][1]

In order to extract it... you must for example do something like:


String line = "011000015O0110000150020802000000000FEDERAL RESERVE BANK 1000 PEACHTREE ST N.E. ATLANTA GA303094470866234568111 ";
String routingNumber = line.substring(0,8);
String officeCode = line.substring(8,9);
String servicingNumber = line.substring(9,17);
String typeCode = line.substring(17,18);
...
...
...
String filler = line.substring(151,line.length());

And `iterate` that code for every line in your file.

In pseudo-code :

for (Line line in File) {
// do the code above
}

***Note:*** Process that file with `JavaScript` will be painful I recommend to do it in the server side of your application.
[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through