473,520 Members | 3,221 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is that possible of reading the .csv file in column wise and the column have different lengths ?

1 New Member
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to get the output like
coloum 1 :

1
1
1
1
until with in the specific length of only.
What logic i have to use?
4 Weeks Ago #1
1 9886
dev7060
639 Recognized Expert Contributor
Is that possible of reading the .csv file in column wise and the column have different lengths ?
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to get the output like
coloum 1 :

1
1
1
1
until with in the specific length of only.
How certain is it the content of the file is present in the correct format? What language, C or C++?

Read line by line.
Use a variable to keep track of the column.
Add number of spaces for index calculation.
Do not process in case of end of line or end of file.
4 Weeks Ago #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
2990
by: Peter Abel | last post by:
Hi all, I'm working under W2k with Python 2.2.2 (#37, Oct 14 2002, 17:02:34) on win32 I have a file *test_data.txt* with the following content: 0123456789 0123456789 abcdefghi ABCDEFGHIJKLMNOPQ
4
1509
by: KriZ | last post by:
Can any tell me how to read a File Property like the Title, Subject, Author.. I have tried using a file call "Interop.DSOleFile.dll", it works...but It is not Strong Named... I want something strong named that can read the File Property.. Thank You..
3
1229
by: AlanS | last post by:
I am reaing files of different format (PDF, XLS, CVS, XML, HTML). I will take the output and store in in an image field in a database table. The following is the code I am using to read the files. public byte getBinaryFile(string pOutputPath) { FileInfo fi = new FileInfo(pOutputPath); byte fileData = new byte; FileStream fs = new...
2
1214
by: PaulR | last post by:
Hi, We seem to have encountered a bug(or working as deigned?) in the import utility on 8.2 LUW. We are using the standard column and char delimiters of , and " while loading files of type DEL. our extract programs which produce the del files, implement a rule which states if a varchar column contains a " output this as ""
4
9809
by: Oliver Knoll | last post by:
According to my ANSI book, tmpfile() creates a file with wb+ mode (that is just writing, right?). How would one reopen it for reading? I got the following (which works): FILE *tmpFile = tmpfile(); /* write into tmpFile */ ...
11
3006
by: Matt DeFoor | last post by:
I have some log files that I'm working with that look like this: 1000000000 3456 1234 1000000001 3456 1235 1000020002 3456 1223 1000203044 3456 986 etc. I'm trying to read the file backwards and just look at the first column. Here's what I've got so far:
0
1515
by: krishnarjun | last post by:
hi to all, suppose i created a sql table with one field..........then i inserted 5 records on that table....... if i use datagrid for accessing these records it ll shows all the records row wise........is there any tools or coding in C# asp.net web application, so that i can access these recoeds in column-wise....... i hope u ll reply me...
12
2842
by: SAL | last post by:
Hello, Is it possible to read a CSV from the Client, and bind my Datagrid to the data in the CSV file without uploading the file to the Server first? I have tried and in Debug mode on my workstation it works fine, but when I publish the page on our DEV server it doesn't fine the CSV file from the client. Has anyone done this before? ...
4
1549
by: Tom | last post by:
I have a datafile which has a form of 10.10 10.20 10.30 ... 20.10 20.20 20.30 ... 30.10 30.20 30.30 ... .. . . .. . . .. . . it has 500 rows and 10002 colums.
0
7235
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7627
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7203
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5765
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3295
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3295
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
855
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
529
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.