I have multiple columns which contains Year format, so basically year format is NOT unique thru out the file, so if i use regular expression then it will fetch values from multiple column and i want all the values from specific single column.
montu3377
Posts
-
Find Year from text in C# -
Find Year from text in C#Hi, I have one flat file which contains data in particular format.The file contains data in particular format which generates pages. Each page contains Year in MM/DD/YYYY format which always starts with specific position means specific x,y coordinate, so out of this it will generate N no of pages. There are multiple dates available in one page like YearStarting , YearEnding etc and out of this i want to find out only particular date like YearStarting. I don't want to find out values for YearEnding. My requirement is that i have to find out each and every YearStarting value contains in the flat file from first line to end of the reports. YearStarting data is having specific position in each pages. Can some one tell me how to find out each value of Year from the Flat file(or text file) using C#?? Thanks a lot.
-
problem in reading .csv filesHi, Can you tell me what are easier ways? I am using following code : //Taking connection using to .csv file string textConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"" + StrInputCSVFile + "\";Extended Properties='text;HDR=No;FMT=Delimited';"; //assigning to oledbconnection string OleDbConnection conn = new OleDbConnection(textConnectionString); // Opening connection conn.Open(); //selecting rows from .csv file sql_select = "Select * from " + InputCSVFile.ToString().Trim() ; //Creates the data adapter OleDbDataAdapter obj_oledb_da = new OleDbDataAdapter(sql_select, conn); //Fills dataset with the records from CSV file obj_oledb_da.Fill(ds); As i have (|) pipe character in my .csv file , so i am specifying (|) pipe sepearter in registry setting otherwise i will NOT get correct parsed values. Pls. let me know if you have some other way rather than this way?? I am eager to seeing that. Thanks a lot for reply.
-
problem in reading .csv filesHi All, I have two C# windows application, both are reading .csv file and doing some processing, however there is one difference between both .csv file. One .csv file is using comma (,) as delimiter (separater) and other .csv file is using |(Pipe) character as delimiter (separater), so basically that is customized seperater. Both .csv file is used by my two different C# windows application. Now here is a problem. My first application used .csv file which has comma(,) as seperater and i am using provider as "Microsoft.Jet.OLEDB.4.0" to reading that file with following connectionstring: string ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + csvfile.Directory.FullName + ";Extended Properties='text;HDR=Yes'"; As by default it's comma, so i don't have to do any changes in my registry to read this file, it's simple but problem came when i am using my other C# windows application. Second C# windows application is using other .csv file which has |(Pipe) character as seperater(delimiter). To read this type of .csv file i used following connection string string textConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"" + StrInputCSVFile + "\";Extended Properties='text;HDR=No;FMT=Delimited';"; As well as in the registry i specified (|) delimiter at following place: HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Jet \ 4.0 \ Engines \ Text i defined "Format" = "Delimited(|)" and second C# application able to read .csv file in correct way but now the problem is that it screwed up my first C# application as it is using comma as seperater. Is there a way to define multiple custom delimiter under registry setting at following place HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Jet \ 4.0 \ Engines \ Text like Delimited("|",",") etc or some thing like that?? I tried that but it didn't work. My questions are : - how can my both C# application should work without effecting each other? As i said , one is having comma(,) as sepearter(delimiter) in .csv file and other is having (|) pipe as sepearter, how can my two different application can work at it's own without effecting each other? - Currently as i defined delimited(|) in above mentioned registry setting so it screwed up first application and my first application is NOT able to read .csv file (which has comma(,) as delimiter) - Is there a way to define Multiple delimiter in registry settings at above mentioned location at registry? I don't want to use scheme.ini file at all. Pls
-
Ms Access reports saving to File system in C#Hi, I have Microsoft Access report in my .mdb file. In this database, i have one report which has attached to one table. From C#.net application,I want to open MsAccess database and get the reports per page and save as .DOC(as word document). Currently issue is that i connected to access database, opened report as well but when i am trying to save it,it's saving without any format like line or table (but on report i have layout like table/lines etc), NOT only that currently it's saving in only one .DOC file. I want to save per page from reports to my C:\test\ drive using C#. Can someone help me pls.?? Thanks in advance.
-
call function from select joinHi, This is quick question regarding calling function from join. In my project i am facing one situation where i need to use join between one temporary table and database table.From that join statement i need to call one function which taking 4 input parameters of temporary table and 4 input parameters of database table and returns one varchar2 value. Now here is question Let's say i creates one join statement like : "Select temp_table.firstname,temp_table.lastname,temp_table.ssn, db_table.firstname,db_table.lastname,db_table.ssn, getmatchtype(temp_table.firstname,.. ,..,..,..,db_table.firstname,..,..,..) from temporary_table ,database_table where ( /* some code in where clause which joins temporary table and database table. */ ) Now my question is that do my getmatchtype(temp_table.firstname,.. ,..,..,..,db_table.firstname,..,..,..) function returns same value for value based on input parameter or it returns different differnt value every time. Or can some one say me that how my function works in join query??? Actually , my requirement is that depends on where clause of join, function takes input parameters and return back to select query and everytime function should return new value for one by one record. Is this join works of not for that?? Can some body help me out for this?? Thankx. regards, montu3377
-
Dynamic Select query issueHi , I had some problem with my select query.Let me explain you whole. I had created dynamic query in my select query as i required performance. My Select query is as below: Select firstname,lastname,dob,ssn from person where ( firstname like 'abc%' and lastname like 'xyz%' OR firstname like 'ypx%' and lastname like 'por%' OR firstname like 'stup%' and lastname like 'rob%' ) Now here i required one more field which is not available in database table (person table). Now that field is MatchType.Matchtype is used for If user input of firstname and lastname is exactly matching with database record then i have to write matchtype ='Exact Match' if user input of first 3 character of firstname and lastname is matching then i have to write Matchtype ='Potiential Match' Now problem is that : If i will write subquery like Select firstname,lastname,dob,ssn, ( Select //some login which return Match type ) as Matchtype from person where ( firstname like 'abc%' and lastname like 'xyz%' OR firstname like 'ypx%' and lastname like 'por%' OR firstname like 'stup%' and lastname like 'rob%' ) If i can't write query like that becoz subquery should return only one value. so can somebody help me out here.?? If you have any question then let me know without hesitation. Thankx a lot in advance. regd, montu3377
-
reg. database connection thru .bat fileHi , I have to upload .csv file data to oracle 10g database from asp.net 2.0 page. As .csv file data are too much large (around 200,000 records) so decided to insert it using Sqlloader utility of oracle. Now to execute sqlloader utility from asp.net web page i have to use .Bat file(Batch file) and where .bat file will take oracle database connection and in first parameter as .csv file. Now i don't know how to take database connection to oracle from .bat file?? even i don't know is it possible or not ?? if it's not possible then what should be the alternative way to take database connection with oracle from .bat file?? Is any article /sample code /link then will be good for me. Thanks in advance. Regards, montu3377
-
Bulk insert from asp.net 2005 to oracleHi, To insert 200,000 records into oracle it's taking around 10 mints time by using Sql loader utility method,so can you pls. suggest some good method which insert records very quickly. I am using .csv file which containts around 200,000 records.I want to insert that records from asp.net to oracle 10g. Can you pls. suggest better way to do it. thanks. montu3377
-
Bulk insert from asp.net 2005 to oracleHi, I have to insert 200,000 rows from datatable (from asp.net 2005 webform(vb.net 2005 code behind ) to oracle 10g table.Here if i insert this by row by row then it will not work,so i need some bulk insert from asp.net to oracle. can anybody suggest some good way to do it.Here we need to take care that as rows are too much large so server or client should not hang. If some code/link is available then it could be helpful to me. thanks montu3377
-
validate .csv file columns valuesHi , ok Good questions: let me give all answers : let's say .csv file has 10K rows with column firstname,lastname,SSN,DOB.Now you are checking record by record and if you find firstname in bad format like numeric then count that row as bad row and then continue for next record and like that you can get how much are good records and how much are bad records and at end of the finding,you need to show to user that let's say 1000 records are bad and 9000 records are good out of 10,000 records. This is how you have to report to user,so user can understand that what's problem with rest of records which are bad. so user can change those records and then upload .csv file again. I hope your now clear abt output.My main problem is to how to validate each and every rows (records).??If i will count one by one record then performance will be def. a issue. regards, Montu3377
-
validate .csv file columns valuesHi, I am facing one huddles in my project.If any one gives solution then it would be great. let me describe : We have user requirement that user has to upload .csv file from client browser which contains around 4 columns.Columns includes like firstname,lastname,SSN,DOB field.Now when user upload .csv file (which may containts more then 10K records) we have to validate those fileds format like firstname should be charater no numeric values include,each SSN value should be numeric not character values like that,so now how can i validate each and every value of each column for 10k records??? we are using asp.net with vb.net(as code behind).Can any body suggest me the good solution for that.??If you have any doubt to understand then feel free to ask me. I will thankfull for that in advance. regards, montu3377
-
import data from .csv file to oracleHi, I have to import data from .csv file (which contains 4 different columns like firstname,lastname,DOB,SSN) into Oracle database by using vb.net and asp.net(web application). This .csv file is very bulky file which may containts upto 10,000 rows. Can any body tell me that what is the faster way to do it thru web page. Any sample code or link is available which solve this issue than it would be very much helpful to me. regd, montu3377
-
Bulk insertion from one table to another tableI am having one physical table in which there are 5 columns and 20,000 rows (say first table) and i want to insert those rows into another physical table(say second table) but before insertion all rows into second physical table ,i need to fetch exact ids of each columns from diff-diff. tables from first phy. table and then when i get those ,insert those ids into second physical tables. Here i am planning to use joins to fetch appropriate id but joins can only usefull when i give one row at a time.I don't want to use cursor to fetch single rows becoz it reduce performance. is there any other way like for-loop in sql server 2005 from which i can loop throw one by one records(rows) till end of first physical table? montu3377
-
Bulk insertion of data in sql serverHi, There is a requirement to insert data into Bulk like 20,000 - 30,000 rows into database (sql server 2005). Description: I have to get one number from text file,bifercate that number and from 1st 5 digit i have to find out ID from sql server 2005 table and then go for second number of that number ,find out ID from sql server 2005 table,this process happens for 4 times for that one number and i have to do same process for 20000 rows. Once i get all those IDs into variables into vb.net from sql server 2005,i have to insert those into one physical table and than one package will run that insert those records into another table. Here main problem i am feeling is speed issue,to process 20000 rows for getting ids and inserting back into sql server takes somuch time. So can some body help me out which way to go to insert records into database using sql server 2005? thanks montu3377
-
Bulk Insertion into database from asp.netSorry for late reply... Let me clarify all more clear. Could you clarify the issue of getting the number from the text file and looking up other numbers from it? Ans: Actually i am having one text file,now there are one column which stores information like a unique number : example: ABC1234A12B243C334 Now from this type of number i have to slip this number like ABC1234 and find that number in one table in db get the according id of that which return 1222 for that row,store this value some where,Now go to another number of same full number that is A12 and find the id from table (yeh definatly all the tables are different not from same table) then store this value somewhere and go on for this number "B243" and find Id from another table and store value somewhere do same thing upto end of the same number (till C334). Tables are different not same. I have to do the same thing for 20,000-30000 rows of that text file. If i do one by one than it takes lots of time becoz in that case i have to take like 20,000-30,000 connection on that time appication may hang up. Once i get all the values(i.e. all the ids) need to insert into one table. Can you pls. tell me that how to do bulk insertion?? montu3377
-
Bulk Insertion into database from asp.netHi, There is a requirement to insert data into Bulk like 20,000 - 30,000 rows into database. Description: I have to get one number from text file,bifercate that number and from 1st 5 digit i have to find out ID from sql server 2005 table and then go for second number of that number ,find out ID from sql server 2005 table,this process happens for 4 times for that one number and i have to do same process for 20000 rows. Once i get all those IDs into variables into vb.net from sql server 2005,i have to insert those into one physical table and than one package will run that insert those records into another table. Here main problem i am feeling is speed issue,to process 20000 rows for getting ids and inserting back into sql server takes somuch time. So can some body help me out which way to go to insert records into database? thanks montu3377
-
Executing Sql server 2005 Job from vb.net?Upto now what i understood is like: My asp.net code execute server Console and that server console application execute the Job and then Job will execute package. Is it true?am i misunderstand anything upto here?? Now here regarding passing Sql command object from asp.net code ,i think i have to pass name of the textfile as input.Now answer of read and write user database then that user has full rights to read and write. Do you have any snappet code/articles which describe scenerio?? thanks montu3377
-
Executing Sql server 2005 Job from vb.net?The Job is going to execute ssis Package and that package takes particular .txt file as input and insert those rows from .txt to sql server table.Due to client requirement i can't run that from sql server console directly.I have to execute Job from browser(say asp.net(vb.net code)) and it starts up the job and job execute ssis package and that package will do it's process. montu3377
-
Executing Sql server 2005 Job from vb.net?The Job is going to execute ssis Package and that package takes particular .txt file as input and insert those rows from .txt to sql server table.Due to client requirement i can't run that from sql server console directly.I have to execute Job from browser(say asp.net(vb.net code)) and it starts up the job and job execute ssis package and that package will do it's process. montu3377