<div dir="ltr">Deepak,<div><br></div><div>It doesn't work like that. We cannot parse MARC21 data with fixed length strings. Here's the MARC21 tutorial - <a href="http://www.loc.gov/marc/umb/um01to06.html">http://www.loc.gov/marc/umb/um01to06.html</a><br>

<div><br></div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 11, 2014 at 2:04 PM, Deepak kumar <span dir="ltr"><<a href="mailto:deepak.kumar.ece11@itbhu.ac.in" target="_blank">deepak.kumar.ece11@itbhu.ac.in</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default"><font face="arial, helvetica, sans-serif">In view</font></div><div class="gmail_default">

<font face="arial, helvetica, sans-serif"><label for="file">Upload text File</label> <%= file_field_tag "file" %></font><br>
</div><div class="gmail_default">In controller</div><div class="gmail_default"><div class="gmail_default">uploaded_file = params[:file]</div><div class="gmail_default">@file_content = uploaded_file.read</div><div class="gmail_default">


<br></div><div class="gmail_default">In this way @file_content becomes an array of whole record.</div><div class="gmail_default">and by indexing I extracted fields like for leader </div><div class="gmail_default">@leader=@file_content[0..23] since the leader is 24 char. long.</div>


<div class="gmail_default"><br></div><div class="gmail_default"><br></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 11, 2014 at 1:59 PM, Ershad K <span dir="ltr"><<a href="mailto:ershad92@gmail.com" target="_blank">ershad92@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Deepak,<div><br></div><div>Can you explain how you parsed the MARC21 file? Also always use proper classes/controllers, it's good to move such logic out of UsersController#new.</div>


</div><div><div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Tue, Mar 11, 2014 at 1:34 PM, Deepak kumar <span dir="ltr"><<a href="mailto:deepak.kumar.ece11@itbhu.ac.in" target="_blank">deepak.kumar.ece11@itbhu.ac.in</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">the link of code <a href="https://github.com/deepakrocks0009/trial" style="font-family:arial" target="_blank">https://github.com/deepakrocks0009/trial</a></div>





</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 11, 2014 at 1:34 PM, Deepak kumar <span dir="ltr"><<a href="mailto:deepak.kumar.ece11@itbhu.ac.in" target="_blank">deepak.kumar.ece11@itbhu.ac.in</a>></span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hello Sir</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">





<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">

I have taken example from <a href="http://www.loc.gov/marc/umb/um11to12.html" style="font-family:arial" target="_blank">http://www.loc.gov/marc/umb/um11to12.html</a></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">






I tried to read MARC record from a text file and output tag, length, start_at and data.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 11, 2014 at 1:57 AM, Ershad K <span dir="ltr"><<a href="mailto:ershad92@gmail.com" target="_blank">ershad92@gmail.com</a>></span> wrote:<br>






<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div>On Tue, Mar 11, 2014 at 1:53 AM, Deepak kumar <span dir="ltr"><<a href="mailto:deepak.kumar.ece11@itbhu.ac.in" target="_blank">deepak.kumar.ece11@itbhu.ac.in</a>></span> wrote:<br>








<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif"><a href="https://github.com/deepakrocks0009/blog" target="_blank">https://github.com/deepakrocks0009/blog</a>  But sir please don't judge me on the basis of this code as I was just beginner at that time.</div>








</div></blockquote><div><br></div></div><div>No worries about that, everybody is beginner at sometime. I just wanted to see some code in action.</div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">








<div dir="ltr">
<div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">So do I need to create database for this or just reading the record from a file? <br></div></div></blockquote>








<div><br></div></div><div>It's your choice, but for now just parsing a valid MARC21 record (which you need to find out) is completely fine.</div><div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">








<div dir="ltr"><div style="font-family:arial,helvetica,sans-serif">
</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 11, 2014 at 1:48 AM, Ershad K <span dir="ltr"><<a href="mailto:ershad92@gmail.com" target="_blank">ershad92@gmail.com</a>></span> wrote:<br>









<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Deepak,<div><br></div><div>Please see if you find and parse a MARC21 record. You are free to use any gem.</div>









<div><br></div><div>Is <a href="http://deepakkeshri.herokuapp.com/" style="font-size:13px" target="_blank">deepakkeshri.herokuapp.com</a> open source? Can I see its source please?</div>

</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 11, 2014 at 1:42 AM, Deepak kumar <span dir="ltr"><<a href="mailto:deepak.kumar.ece11@itbhu.ac.in" target="_blank">deepak.kumar.ece11@itbhu.ac.in</a>></span> wrote:<br>











<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif">This was my blog app <a href="http://deepakkeshri.herokuapp.com/" style="font-family:arial" target="_blank">http://deepakkeshri.herokuapp.com/</a> which I made when I was just a beginner. After that I learnt a lot of things.</div>












</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 11, 2014 at 1:34 AM, Deepak kumar <span dir="ltr"><<a href="mailto:deepak.kumar.ece11@itbhu.ac.in" target="_blank">deepak.kumar.ece11@itbhu.ac.in</a>></span> wrote:<br>












<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif">Hello Bhaiya,</div><div style="font-family:arial,helvetica,sans-serif">












<br></div><div style="font-family:arial,helvetica,sans-serif">
You are right. Using STI we will reduce the number of tables. </div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">




My github link is <a href="http://github.com/deepakrocks0009" target="_blank">github.com/deepakrocks0009</a>. But I dont have any big project in my account. The project on which I worked during 2013 summer was <a href="http://schoolmitra.com" target="_blank">schoolmitra.com</a> and since it was private company they closed my bitbucket account after internship. </div>













<div style="font-family:arial,helvetica,sans-serif">Till now I haven't tried to parse MARC records. But you can give me task before I submit my proposal. </div><div style="font-family:arial,helvetica,sans-serif">




<br></div><div style="font-family:arial,helvetica,sans-serif">Ya please put this thread to mailing list.</div><div style="font-family:arial,helvetica,sans-serif">How many applications do you received for this project?</div>













<div style="font-family:arial,helvetica,sans-serif">Kind Regards</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 11, 2014 at 12:55 AM, Ershad K <span dir="ltr"><<a href="mailto:ershad92@gmail.com" target="_blank">ershad92@gmail.com</a>></span> wrote:<br>













<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi Deepak,</div><div><br></div>Yeah, but we could make it better using rails's STI. Also have you tried to parse the MARC records? Can you please link to the projects you worked on? Preferably in rails?<div>















<br></div></div><div>Can I CC this thread to <a href="mailto:student-projects@lists.smc.org.in" target="_blank">student-projects@lists.smc.org.in</a> ?<div><br><div><br></div><div>PS: Don't call me sir, call me Ershad :-)</div>













</div><div><div><div><div class="gmail_extra">

<br><div class="gmail_quote">On Mon, Mar 10, 2014 at 10:54 PM, Deepak kumar <span dir="ltr"><<a href="mailto:deepak.kumar.ece11@itbhu.ac.in" target="_blank">deepak.kumar.ece11@itbhu.ac.in</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">















<div dir="ltr"><div style="font-family:arial,helvetica,sans-serif">Hello Sir,</div><div style="font-family:arial,helvetica,sans-serif">We can have two tables to store MARC 21 data. First table will contain columns which are field_id, field tag, its value. 2nd table will contain sub field tag and its value differentiated on the basis of field_id. </div>

















<div style="font-family:arial,helvetica,sans-serif">We need to have an extra default row in the table. If the field doesn't matches existing fields of db then the default row will be used.</div>
<div style="font-family:arial,helvetica,sans-serif">Is this correct?</div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 10, 2014 at 10:17 PM, Ershad K <span dir="ltr"><<a href="mailto:ershad92@gmail.com" target="_blank">ershad92@gmail.com</a>></span> wrote:<br>
















<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi Deepak,<div><br></div><div>Do you have any idea about how to store these data in database? What happens when we encounter new data fields while importing the data? Thoughts?</div>
















</div><div><div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Mon, Mar 10, 2014 at 6:30 PM, Deepak kumar <span dir="ltr"><<a href="mailto:deepak.kumar.ece11@itbhu.ac.in" target="_blank">deepak.kumar.ece11@itbhu.ac.in</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


















<div dir="ltr"><div style="font-family:arial,helvetica,sans-serif">You are right sir, the database for the fields is really huge. It has 887 control fields and there sub fields, so total of 6000+ field types.</div>




<div style="font-family:arial,helvetica,sans-serif">It is very difficult to have a look up table for each field. We have to use very good data structure. but there are large number of tools for decoding. We can take help of them. <a href="http://www.loc.gov/marc/marctools.html" target="_blank">http://www.loc.gov/marc/marctools.html</a></div>



















</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Mar 9, 2014 at 3:20 PM, Deepak kumar <span dir="ltr"><<a href="mailto:deepak.kumar.ece11@itbhu.ac.in" target="_blank">deepak.kumar.ece11@itbhu.ac.in</a>></span> wrote:<br>



















<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif">















Thank you sir for your reply. </div>




<div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">I am quite good with ruby on rails and its mvc architecture. The project on which I had worked was <a href="http://www.schoolmitra.com" target="_blank">www.schoolmitra.com</a>. It was basically web application using ruby and its framework RoR.</div>





















<div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif"><div>I have gone through your blog and your weekly update during GSOC'13 and it is quite impressive.</div>




















<div>Some Similar works I also did during my summer internship. Implementing authentication, post comment and like feature, student database management, monthly report generation in PDFs form, defining role through rolify and ability through cancan, bootstrap for css, SQlite formanaging database, sms alert functionality, javaScript and little jquery for dynamic pages. But I don't know haml. I used to make my view page in ruby only. I will learn it. </div>




















<div><br></div><div>Kind Regards</div></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Mar 8, 2014 at 1:31 PM, Ershad K <span dir="ltr"><<a href="mailto:ershad92@gmail.com" target="_blank">ershad92@gmail.com</a>></span> wrote:<br>




















<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi Deepak,<div><br></div><div>Sorry, I was busy, wasn't able to send you a reply.</div>















<div class="gmail_extra">




<br><br><div class="gmail_quote"><div>On Thu, Mar 6, 2014 at 1:34 PM, Deepak kumar <span dir="ltr"><<a href="mailto:deepak.kumar.ece11@itbhu.ac.in" target="_blank">deepak.kumar.ece11@itbhu.ac.in</a>></span> wrote:<br>






















</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div>















Hello Sir,<br><br></div><div>As 
suggested, I have gone through the documentation of MARC21. What I have 
understood is, MARC21 is a basically formatting of certain records/data 
either bibliographic, authority, holdings, or community information. In 
other words we can say it as encoding and decoding process of records in
 a fixed format. Today MARC21 is most predominant and widely used. So in
 order to import data from a MARC21 record we have to read the record 
character by character and perform decoding operation. The project says 
we have to import and export data in MARC21 records. The only tough 
thing about this project is to know the MARC21 format. <br>
</div></div><div>So my steps will be <br></div></div><div>1. Reading the MARC21 record file as
 a string or reading fixed number of character from record each time 
instead of reading whole record as single string.<br></div></div><div>2. Assigning these fixed length strings to fixed variables.(Tag,length,start position,end position)<br>
</div></div><div>3. With the help of these tags reading the rest of file.<br></div></div><div>4. Lastly formatting these pieces of data in fixed format for end users with the help of inbuilt database.<br>
</div></div></div></div></blockquote><div><br>

</div><div>There's some problem here. First, we cannot really read MARC21 records by reading with a fixed number of characters. Last time I checked, it has around 3000+ different fields with different type of data. Each file has many subfield marked with leader tags or something. We cannot proceed with this project until we have a clear understanding of how MARC21 works.</div>






















<div><br></div><div>In addition to that, the scope of this project is not merely parsing the MARC21 data. We have to make necessary changes in Grandham application to add import/export feature. That includes changes in the current DB schema. How good are you with Ruby on Rails?</div>




















<div><div>

<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><br></div>This will be basic idea of my work. Please correct me wherever I am wrong also if I am missing any point.<br>
























</div><div>Please tell when you are available on IRC . I have posted this mail to mailing list but didn't got any reply.<br></div>Kind Regards,<div><br><br clear="all"><span style="color:rgb(80,0,80);font-size:small;font-family:arial">Deepak Kumar</span><div style="color:rgb(80,0,80);font-size:small;font-family:arial">
























Electronics Engineering</div><div style="color:rgb(80,0,80);font-size:small;font-family:arial">B.Tech III Year<br></div></div><div style="color:rgb(80,0,80);font-size:small;font-family:arial">IIT (BHU),Varanasi,India <br>






















</div>

<div style="color:rgb(80,0,80);font-size:small;font-family:arial">Mob: <a href="tel:%2B918423542271" value="+918423542271" target="_blank">+918423542271</a></div><a href="http://about.me/deepak.keshri/#" target="_blank">http://about.me/deepak.keshri/</a></div>























<div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div><span style="color:rgb(80,0,80);font-size:small;font-family:arial">Deepak Kumar</span><div style="color:rgb(80,0,80);font-size:small;font-family:arial">

Electronics Engineering</div>
<div style="color:rgb(80,0,80);font-size:small;font-family:arial">B.Tech III Year<br></div></div><div style="color:rgb(80,0,80);font-size:small;font-family:arial">IIT (BHU),Varanasi, India</div><div style="color:rgb(80,0,80);font-size:small;font-family:arial">























Mob: <a href="tel:%2B918423542271" value="+918423542271" target="_blank">+918423542271</a></div><div style="color:rgb(80,0,80);font-size:small;font-family:arial"><a href="http://about.me/deepak.keshri/#" target="_blank">http://about.me/deepak.keshri/</a><br>




















</div></div></div><div><div>


<br><br><div class="gmail_quote">On Sat, Mar 1, 2014 at 9:32 PM, Ershad K <span dir="ltr"><<a href="mailto:ershad92@gmail.com" target="_blank">ershad92@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">























<div dir="ltr">Hi Deepak,<div><br></div><div>The project is about implementing MARC21[1] data support in Grandham. </div><div><br></div><div>Grandham is written in Ruby on rails, the project involves developing MARC21 extensions the platform and integrate it to the current API.  Please drop a mail to <a href="mailto:discuss@lists.smc.org.in" target="_blank">discuss@lists.smc.org.in</a> with your preliminary analysis.  </div>

























<div><br></div><div>[1] <a href="http://www.loc.gov/marc/bibliographic/" target="_blank">http://www.loc.gov/marc/bibliographic/</a></div></div><div class="gmail_extra"><div><div><br><br><div class="gmail_quote">
On Sat, Mar 1, 2014 at 3:43 PM, Deepak kumar <span dir="ltr"><<a href="mailto:deepak.kumar.ece11@itbhu.ac.in" target="_blank">deepak.kumar.ece11@itbhu.ac.in</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hello Sir,<br>I went through your project on grandham and i would like to contribute to it as my gsoc'14 project.<br>

























Please guide me regarding this.<span><font color="#888888"><br><br clear="all"><div><div dir="ltr"><span style="color:rgb(80,0,80);font-size:small;font-family:arial">Deepak Kumar</span><div style="color:rgb(80,0,80);font-size:small;font-family:arial">


























Electronics Engineering</div><div style="color:rgb(80,0,80);font-size:small;font-family:arial">B.Tech III Year<br></div><div style="color:rgb(80,0,80);font-size:small;font-family:arial">IIT (BHU),Varanasi </div><div style="color:rgb(80,0,80);font-size:small;font-family:arial">


























Mob: 08423542271</div><div style="color:rgb(80,0,80);font-size:small;font-family:arial"><a href="http://about.me/deepak.keshri/#" target="_blank">http://about.me/deepak.keshri/</a><br></div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><div dir="ltr">Regards,<br>Ershad K<br><a href="http://ershadk.com" target="_blank">http://ershadk.com</a></div>

</font></span></div>
</blockquote></div><br></div></div></div>
</blockquote></div></div></div><div><div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Regards,<br>Ershad K<br><a href="http://ershadk.com" target="_blank">http://ershadk.com</a></div>
</div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Regards,<br>Ershad K<br><a href="http://ershadk.com" target="_blank">http://ershadk.com</a></div>
</div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Regards,<br>Ershad K<br><a href="http://ershadk.com" target="_blank">http://ershadk.com</a></div>
</div></div></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Regards,<br>Ershad K<br><a href="http://ershadk.com" target="_blank">http://ershadk.com</a></div>
</div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div></div></div><div><div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Regards,<br>Ershad K<br><a href="http://ershadk.com" target="_blank">http://ershadk.com</a></div>
</div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Regards,<br>Ershad K<br><a href="http://ershadk.com" target="_blank">http://ershadk.com</a></div>
</div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Regards,<br>Ershad K<br><a href="http://ershadk.com" target="_blank">http://ershadk.com</a></div>
</div>