how to sketch these two codes in one UNO

LOCK

#include <Adafruit_Fingerprint.h>

int electronic_lock = 8;
// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino (WHITE wire)
SoftwareSerial mySerial(4, 5);// Tx, Rx

Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

void setup()
{
pinMode(8, OUTPUT);
Serial.begin(9600);
while (!Serial);
delay(100);
// set the data rate for the sensor serial port
finger.begin(57600);

if (finger.verifyPassword()) {
Serial.println("Found fingerprint sensor");
} else {
Serial.println("Did not find fingerprint sensor");
while (1) { delay(1); }
}

finger.getTemplateCount();
Serial.print("Sensor contains "); Serial.print(finger.templateCount); Serial.println(" template(s)");
Serial.println("Waiting for valid finger...");
}

void loop() // run over and over again
{
getFingerprintIDez();
delay(50); //don't ned to run this at full speed.
}

int getFingerprintIDez() {
uint8_t p = finger.getImage();
if (p != FINGERPRINT_OK) return -1;

p = finger.image2Tz();
if (p != FINGERPRINT_OK) return -1;

p = finger.fingerFastSearch();
if (p != FINGERPRINT_OK) return -1;

// found a match!
Serial.print("Found ID #"); Serial.print(finger.fingerID);
Serial.print(" with confidence of "); Serial.println(finger.confidence);
digitalWrite(electronic_lock, HIGH);
delay(1500); //Change the door lock delay from here
digitalWrite(electronic_lock, LOW);
Serial.println("Unlocked");
return finger.fingerID;
}
LCD
#include <Adafruit_Fingerprint.h>
#include <SoftwareSerial.h>
#include <Wire.h> // Comes with Arduino IDE
#include <LiquidCrystal_I2C.h>
// Initialize the object with interfacing pins
LiquidCrystal_I2C lcd(0x3f, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
SoftwareSerial mySerial(4, 5);
SoftwareSerial sms(2, 3);

int numdata;
boolean started = false;

Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

bool found = 0;
bool matched = 0;
int return_id;

uint8_t id;

void setup()
{
sms.begin(9600);
pinMode(8, OUTPUT);

lcd.begin(20, 4); // Initialize 20X4 LCD and turn on backlight
lcd.backlight();

Serial.begin(9600);
Serial.println("Adafruit finger detect test");

// set the data rate for the sensor serial port
finger.begin(57600);

if (finger.verifyPassword()) {
Serial.println("Found fingerprint sensor!");
} else {
Serial.println("Did not find fingerprint sensor :(");
while (1);
}
lcd.setCursor(0, 0);
lcd.print("Biomatric Door Lock ");
lcd.setCursor(0, 1);
lcd.print(" System ");

delay(3000);
lcd.clear();

lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Place the finger");
}

void loop() // run over and over again
{

int getFingerprintID();
if (found == 1)
{
if (matched == 1)
{
lcd.setCursor(0, 1);
lcd.print("Access Granted");
digitalWrite(8, HIGH);
delay(2000);
digitalWrite(8, LOW);
sms.print("0");
}
else
{
sms.print("1");
lcd.setCursor(0, 1);
lcd.print("Access Denied");
digitalWrite(8, LOW);
}
}
else
{
lcd.setCursor(0, 0);
lcd.print("Place the finger");

lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(0, 2);
lcd.print(" ");
lcd.setCursor(0, 3);
lcd.print(" ");
}
delay(50);
}

OK, first things first.

You need to go and read the forum instructions so that you can go back and modify your original post (not re-post it) - using the "More -> Modify" option below the right hand corner of your post - to mark up your code as such using the "</>" icon in the posting window. Just highlight each section of code (or output if you need to post that) from the IDE and click the icon.

In fact, the IDE itself has a "copy for forum" link to put these markings on a highlighted block for you so you then just paste it here in a posting window. But even before doing that, don't forget to use the "Auto-Format" (Ctrl-T) option first to make it easy to read. If you do not post it as "code" it can as you now see, be a little garbled and is always more difficult to read due to the font.

It is inappropriate to attach it as a ".ino" file unless it is clearly too long to include in the post proper. People can usually see the mistakes directly and do not want to have to actually load it in their own IDE. And even that would also assume they are using a PC and have the IDE running on that PC.

Your blank space is reasonably tidy - often a problem here. Do use blank lines, but only single blanks between complete functional blocks.

Maybe then we can try and figure out what it all does. :grinning:

When posting code please use the code button </>
codeButton.png

so your code 
looks like this

and is easy to copy to a text editor See How to use the forum

Also please use the AutoFormat tool to indent your code for easier reading.

This Simple Merge Demo may help

Before trying to merge the programs go through each of them carefully to make sure they are not trying to use the same resource - for example an I/O pin. If you find conflicts change something in one of the separate programs and make sure it still works with the change.

...R