Login and register from txt file using java | fun with java #1

Published: 13 June 2019
on channel: RAPIDCLICKS
58,953
737

This video basically an implementation to write in txt (text) file and retrieve its data in a formal way. Enjoy :)

Got stuck somewhere?
Download the source code: https://github.com/Nilesh-d/TextLogin


Explanation
8:13
addData :
1) Fetch file
2) skip no. of lines already exists
3) write batch files

(you should skip checkData, it only work for single batch of data)

22:27
logic:

working:
1)loop through each data batch
2)check user and password if match, then print found and exit
3)if last data batch then print not found and exit
4)skip lines that are not username and password i.e email, blank line,etc.

1) increments = number of data in single batch
exp: loop through no. of data batches

2) check for incorrect user = increments - 1
exp: check if current batch is the last batch of entire document and no user and password matched.

3) lines to skip = k = increments - data lines other than user and password
exp: we need only user and password to check and skip other lines of single batch

variables values need to be adjusted:
i+= [increments] (no. of data batch)
ln-[increments - 1] (no. of lines inside each batch - 1)
k till= [k] (no. of lines to skip)

batch example:(no. of lines inside each batch should be equal)
---------------------
Username:youtube
password:pass
email:mail@mail.com

Username:stack
password:overflow
email:stack@mail.com
----------------------

no. of data batches = 2
no. of lines inside each batch (4) - 1 = 3 (except last batch,including blank line)
no. of lines to skip = 2 (except last batch, including blank line)



audio credit: www.bensound.com


On this page of the site you can watch the video online Login and register from txt file using java | fun with java #1 with a duration of hours minute second in good quality, which was uploaded by the user RAPIDCLICKS 13 June 2019, share the link with friends and acquaintances, this video has already been watched 58,953 times on youtube and it was liked by 737 viewers. Enjoy your viewing!